web-dev-qa-db-ja.com

パーサー「babylon」の非推奨エラー-Webpackビルド

プロジェクトのJSパッケージをアップグレードした後、Webpackでバンドルをビルドするとエラーが表示されました。これは.vue-fileをビルドするときに表示されるようで、どの.vue-fileビルドでも表示できます。 package.jsonに「babylon」がなく、新しい@ babel/coreバージョン(7.2.2)を持っています。

これはエラーです:

{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }

.vue-ファイルをビルドするときにのみ表示されるようです。

これが私の設定です:

。babelrc

{
  "presets": ["@babel/preset-env"],
  "plugins": ["@babel/plugin-transform-regenerator"]
}

Webpack設定:

module: {
rules: [
  {
    enforce: 'pre',
    test: /\.(js|vue)$/,
    loader: 'eslint-loader',
    exclude: /node_modules/
  },
  {
    test: /\.vue$/,
    loader: 'vue-loader',
    options: {
      loaders: {
        scss: 'vue-style-loader!css-loader!sass-loader',
        sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax'
      }
    }
  },
  {
    test: /\.js$/,
    exclude: /node_modules/,
    use: [ 'babel-loader' ]
  },
  {
    test: /\.sass$/,
    exclude: /node_modules/,
    use: ExtractTextPlugin.extract({
      fallback: 'style-loader',
      use: [
        {
          loader: 'css-loader',
          options: {
            sourceMap: true
          }
        },
        {
          loader: 'postcss-loader',
          options: {
            sourceMap: true
          }
        },
        {
          loader: 'sass-loader',
          options: {
            sourceMap: true
          }
        }
      ]
    })
  }
]

}

。eslintrc.js

  extends: [
'eslint:recommended',
'plugin:vue/recommended',
'plugin:import/errors',
'plugin:import/warnings'
],
 settings: {
'import/resolver': {
  'node': {
    'extensions': [
      '.js',
      '.vue'
    ]
  }
 }
 },
  parserOptions: {
  parser: 'babel-eslint',
  ecmaVersion: 2018
 }

package.json

"dependencies": {
    "@fortawesome/fontawesome-free": "^5.1.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.10",
    "@fortawesome/free-solid-svg-icons": "^5.6.1",
    "@fortawesome/vue-fontawesome": "^0.1.3",
    "autoprefixer": "^9.4.6",
    "axios": "^0.18.0",
    "babel-eslint": "^10.0.1",
    "babel-polyfill": "^6.23.0",
    "backbone": "^1.3.3",
    "bulma": "^0.7.1",
    "bulma-calendar": "^5.0.3",
    "clean-webpack-plugin": "^1.0.1",
    "css-loader": "^0.28.4",
    "extract-text-webpack-plugin": "^3.0.0",
    "flickity": "^2.0.9",
    "flickity-imagesloaded": "^2.0.0",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "glob-all": "^3.1.0",
    "in-view": "^0.6.1",
    "jquery": "^3.2.1",
    "js-cookie": "^2.2.0",
    "lazysizes": "^4.0.2",
    "magnific-popup": "^1.1.0",
    "node-pre-gyp": "^0.12.0",
    "node-sass": "^4.7.2",
    "optimize-css-assets-webpack-plugin": "^3.0.0",
    "postcss-loader": "^3.0.0",
    "purify-css": "^1.2.5",
    "purifycss-webpack": "^0.7.0",
    "sass-loader": "^6.0.7",
    "style-loader": "^0.18.2",
    "underscore": "^1.8.3",
    "vue": "2.5.22",
    "vue-affix": "^0.2.4",
    "vue-lazyload": "^1.2.6",
    "vue-loader": "13.7.2",
    "vue-template-compiler": "2.5.22",
    "vuex": "^3.0.1",
    "webpack": "^3.4.1",
    "webpack-bundle-analyzer": "^2.8.3",
    "webpack-bundle-tracker": "^0.2.0",
    "webpack-dev-server": "^2.6.1",
    "webpack-merge": "^4.1.0"
},
"devDependencies": {
    "@babel/core": "^7.2.2",
    "@babel/plugin-transform-regenerator": "^7.0.0",
    "@babel/preset-env": "^7.3.1",
    "babel-loader": "^8.0.5",
    "eslint": "^4.14.0",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-vue": "4.7.1"
}
6
Kris D. J.

Vue-loaderリポジトリからのPR: https://github.com/vuejs/vue-loader/pull/148

0
qkdreyer