1、插件等优化体积:
1、插件等优化体积:
https://blog.csdn.net/weixin_68531033/article/details/126342877
https://mdnice.com/writing/648571358c24425794f8aa62bd5e52ae
2、Close SourceMap
module.exports = {
productionSourceMap: false
}
3、vue.config.js的TerserPlugin打包配置:
new TerserPlugin({
terserOptions: {
compress: {
drop_console: true, // 传true就是⼲掉所有的console.*这些函数的调⽤.
drop_debugger: true, // ⼲掉那些debugger;
pure_funcs: ['console.log'] // 如果你要⼲掉特定的函数⽐如console.info ,⼜想删掉后保留其参数中的副作⽤,那⽤pure_funcs来处理
},
// 开启多进程打包
parallel: true,
// 启动source-map
sourceMap: false
}
})