webpack打包到线上配置去掉console
2019-03-07 本文已影响0人
团猫咪爱吃玉米
修改webpack.prod.conf.js
文件中的UglifyJsPlugin
插件配置:
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false,
drop_debugger: true, //去掉debugger
drop_console: true, // 去掉console
pure_funcs: ['console.log']// 移除console
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
})