启动webpack-dev-server错误,ERROR in main.js from UglifyJs Unexpected token: name «element», expected: punc «;»
启动webpack-dev-server出现以下错误
ERROR in main.js from UglifyJs
Unexpected token: name «element», expected: punc «;» [main.js:906,8]
解决方法
1.添加.babelrc,添加以下内容
{
"presets": ["@babel/env"]
}
2.webpack.config.js添加以下内容
module: {
rules: [
...
{ test: /\.js$/, use: 'babel-loader' }
]
}
本文来自博客园,作者:广林,转载请注明原文链接:https://www.cnblogs.com/guanglin/p/11419432.html