webpack 4.x remove console.log
solutions
- only remove the
console.log
but leave other consoles (recommend ✅)
pure_funcs: ['console.log']
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
// webpack.config.js
module.exports = {
// ...
optimization: {
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
compress: {
pure_funcs: [
'console.log',
// 'console.error',
// 'console.warn',
// ...
],
},
//
…
Top comments (0)