做个记录
首先这是按官方要求修改后的 .babelrc 内容:
{
"presets": [["es2015", { "modules": false }]],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
出现第一个报错
//解决上图报错
npm install --save-dev babel-preset-es2015
————————————————————————————
接下来出现第二个报错:
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
解决方法:
在build/webpack.base.conf.js文件中,注释或者删除掉:module->rules中有关eslint的规则(红色这行)
module: {
rules: [
//…(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /.vue$/,
loader: ‘vue-loader’,
options: vueLoaderConfig
},
…
完美解决