How to preserve console.log in production mode?

Hello !

Question about Vue CLI and console.log statement in production mode

I try to keep console.* method call in production mode for our staging build.

Vue CLI default config delete call to console.* during production build.
I thought it was a Terser option but in terser default config (@vue/cli-service/lib/config/terserOptions.js), don’t find any drop_console options set to true and terser default is set to false.

So, how can I preserve console.* statement with a production build ?

Thank you !

Looks like some other devs had the same problem but they were trying to set it to true. Maybe this can help you Is it possible to modify and/or extend the options passed to the TerserPlugin with the webpack-chain API?