How to remove console.log from vue cli 3.0File Compression

it is expected that after the vue is packaged, the debugging information console.log in the project can be automatically removed.
I added this section to my configuration item in the vue.config.js file

configureWebpack:{
    optimization: {
      minimizer: [
        new UglifyJsPlugin({
          uglifyOptions: {
            compress: {
              warnings: false,
              drop_console: true,//console
              drop_debugger: false,
              pure_funcs: ["console.log"]//console
            }
          }
      })
    ]
    }
  }

however, it does not look at the desired effect.

Jul.11,2022

vue.config.js

configureWebpack: config => {
    if (process.env.NODE_ENV === 'production') {
      config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
    }
  }
  developmentconfig.optimizationundefined 

https://codeshelper.com/a/11...

< H2 > use babel-plugin-transform-remove-console plug-ins < / H2 >
install dependent libraries

wepack4:<br>configureWebpack: {

optimization: {
  minimizer: [
    new UglifyJsPlugin({
      uglifyOptions: {
        compress: {
          warnings: false,
          drop_console: true, //console
          drop_debugger: false // pure_funcs: ['console.log']
        }
      }
    })
  ]
}

},

Menu