Upgrade Webpack of Vue-Cli Projects from 3 to 4
package.json
Change webpack related devDependencies versions:
webpack
to^4
webpack-dev-server
to^3
- Add
webpack-cli
- Replace
extract-text-webpack-plugin
withmini-css-extract-plugin
- Replace
uglifyjs-webpack-plugin
withterser-webpack-plugin
{ |
webpack.base.conf.js
Add mode
option.
// ... |
webpack.prod.conf.js
- Add
performance
andoptimization
option - Replace
ExtractTextPlugin
withMiniCssExtractPlugin
- Remove
UglifyJsPlugin
and allwebpack.optimize.CommonsChunkPlugin
// ... |
That’s it, enjoy. 🎉