You will require babel plugin to remove the console.log from production build.
npm install babel-plugin-transform-remove-console --save-dev
If you are using vue-cli 3. you will find babel.config.js file where you can include this plugin.
const removeConsolePlugin = []
if(process.env.NODE_ENV === 'production') {
  removeConsolePlugin.push("transform-remove-console")
}
module.exports = {
  presets: [
    '@vue/app'
  ],
  plugins: removeConsolePlugin
}
https://forum.vuejs.org/t/remove-console-logs-from-production-buils/39327 
No comments:
Post a Comment