阅读:1852回复:1
babel-core升级为@babel/core ,eslint-loader升级为eslint-webpack-plugin, babel-eslint升级为@babel/eslint-parser
先把之前相关的包都卸载,再重装
涉及到的改动文件 package.json "@babel/core": "^7.18.6", "@babel/eslint-parser": "^7.18.2", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-transform-runtime": "^7.18.6", "@babel/preset-env": "^7.18.6", "@babel/runtime": "^7.18.6", "babel-plugin-transform-vue-jsx": "^3.7.0", "vue-loader": "14.2.4", .babelrc文件 { "presets": [ "@babel/preset-env" ], "plugins": [ "@babel/plugin-transform-runtime", "@babel/plugin-proposal-class-properties", "transform-vue-jsx" ] } .eslintrc.js文件parser: '@babel/eslint-parser' webpack.dev.conf.js const ESLintPlugin = require('eslint-webpack-plugin'); plugins: [ ... new ESLintPlugin({ fix: true, // 启用ESLint自动修复功能 extensions: ['js', 'jsx'], context: resolve('src'), // 文件根目录 exclude: ['/node_modules/', '/src/icons/index.js'],// 指定要排除的文件/目录 cache: true //缓存 }) ] http://bbs.8090bus.net/index.php?c=post&fid=31 |
|
沙发#
发布于:2024-03-01 13:38
|
|