webpack.optimize.UglifyJsPlugin has been removed, please use config.optimiza

报错如下图:

webpack.optimize.UglifyJsPlugin has been removed, please use config.optimiza_第1张图片

解决: webpack4.x 使用mini-css-extract-plugin代替 extract-text-webpack-plugin  

使用方式:

 

webpack.optimize.UglifyJsPlugin has been removed, please use config.optimiza_第2张图片

 

也有小伙伴通过升级npm i extract-text-webpack-plugin@next -D 升级后是beta版本所以没有采用

你可能感兴趣的:(web前端)