webpack配置删除console

1.删除所有的console.log

vue.config.js:

module.exports = defineConfig({
    configureWebpack: (config) => {
      // 删除console
      config.optimization.minimizer[0].options.minimizer.options.compress = Object.assign(
        config.optimization.minimizer[0].options.minimizer.options.compress,
        {
          drop_console: true
        }
      );
  }
})

posted on 2023-10-09 14:38  IT丶Hatcher  阅读(615)  评论(0)    收藏  举报

导航