生产环境配置:
1.压缩代码:
// 代码压缩
uglifyjs-webpack-plugin
2.压缩js
compression-webpack-plugin3.压缩css
compression-webpack-plugin4.压缩图片
image-webpack-loader5.去除console
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true6.去除debugger
config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true7.开启gzip
compression-webpack-plugin
8.配置cdn
9.公共代码抽离
10.使用cdn的vue.min.js
11.去除map文件
productionSourceMap设置为false