const TerserPlugin = require("terser-webpack-plugin");

module.exports = {
  // 其他配置项...
  optimization: {
    minimize: true, // 必须开启，否则配置不失效
    minimizer: [
      new TerserPlugin({
        terserOptions: {
          compress: {
            drop_console: true
          }
        }
      })
    ]
  }
};