Upgrade Webpack of Vue-Cli Projects from 3 to 4
package.json
Change webpack related devDependencies versions:
webpackto^4webpack-dev-serverto^3- Add
webpack-cli - Replace
extract-text-webpack-pluginwithmini-css-extract-plugin - Replace
uglifyjs-webpack-pluginwithterser-webpack-plugin
{ |
webpack.base.conf.js
Add mode option.
// ... |
webpack.prod.conf.js
- Add
performanceandoptimizationoption - Replace
ExtractTextPluginwithMiniCssExtractPlugin - Remove
UglifyJsPluginand allwebpack.optimize.CommonsChunkPlugin
// ... |
That’s it, enjoy. 🎉