I am trying to remove console.logs with Webpack\'s Uglify plugin but it seems that Uglify plugin that comes bundled with Webpack doesn\'t have that option, its
this is what I've done to remove alert() and console.log() from my codes. global_defs => replace alerts with console.log then drop_console removes all console.logs and now nothing shows up in my browser console
new UglifyJsPlugin({
uglifyOptions: {
compress: {
global_defs: {
"@alert": "console.log",
},
drop_console: true
}
}
}),
plugin versions:
"webpack":3.12.0, "webpack-cli": "^3.0.3", "uglifyjs-webpack-plugin": "^1.2.5",
Right now uglifyjs-webpack-plugin v1.2.6 has been released and I used latest documentations for this one, So I suppose there wont be any problem with latest plugin too.