在build/webpack.prod.conf.js里面
添加如下代码
const webpackConfig = merge(baseWebpackConfig, {
plugins: [
new webpack.optimize.UglifyJsPlugin({ //自动删除console.log
compress: {
warnings: false,
drop_debugger: true,
drop_console: true,
pure_funcs: ['console.log']
},
sourceMap: true,
parallel: true,
}),
]
})
原文地址:https://www.cnblogs.com/lxk0301/p/11684149.html
时间: 2024-10-09 15:05:01