原因:使用了ES6的语法需要安装uglifyjs-webpack-plugin
1.安装
npm i -D uglifyjs-webpack-plugin
2.修改webpack.conf.js
//添加
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
//替换将
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
//替换为
new UglifyJsPlugin({
"uglifyOptions":
{
compress: {
warnings: false
},
sourceMap: true
}
}
),
标签:UglifyJsPlugin,Unexpected,punc,plugin,js,webpack,false,uglifyjs
From: https://www.cnblogs.com/guowenrui/p/17048201.html