生产环境下想要忽略掉列如'console.log'这类关键字该如何操作?
webpack5的文档看来看去只查到'terser-webpack-plugin'这个插件,
但是写来写去始终无法做到忽略指定关键字
new TerserPlugin({
terserOptions: {
format: {
comments: /console/i,
}
},
extractComments: true,
})
最好贴下你的 Webpack 配置。