1

在vue项目结束执行npm run build出现错误如下
图片描述
报错点在uglifyjs-webpack-plugin于是
对比一下之前的 package.json,发现 uglifyjs-webpack-plugin 的版本是 0.4.6,但现在已经是1.1.4了。然后发现了README.md文件开头的一段话:

 webpack =< v3.0.0 currently contains v0.4.6 of this plugin under `webpack.optimize.UglifyJsPlugin as an alias. For usage of the latest version (v1.0.0), please follow the instructions below. Aliasing v1.0.0 as webpack.optimize.UglifyJsPlugin is scheduled for webpack v4.0.0
 解决办法:
     1手动改写package.json中的uglifyjs-webpack-plugin版本号将原来的1.1.4改为^0.4.6
     2 重新npm install
     3 再进行npm run build

遇到问题,小记......


LYIN
39 声望5 粉丝

WEB前端