Package to remove console.log
When you are developing a project, you need to see the results of some back-end interfaces. You will use console.log many times. When you are packing the project, you will find a lot of console.log on the console. Here’s how to block all console. logs in a Vue project at once
In vue.config.js, configure:
chainWebpack(config) {
config.optimization.minimizer('terser').tap((args) = > {
args[0].terserOptions.compress.drop_console = true
return args
})
}
Copy the code
And then pack it to see what happens