ERROR in static/js/xxx.js from UglifyJs
Unexpected token name «currentVersion», expected punc
遇到这种异常, 需要运行下面脚本
运行npm i -D uglifyjs-webpack-plugin@beta
修改webpack.prod.conf.js
将原来的
new webpack.optimize.UglifyJsPlugin ({
compress: {
warnings: false
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
改成
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
new UglifyJsPlugin(),
问题解决!
版权声明:本文为Java_user_user原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。