Can't remove `console` statements with babel nor terser in vue cli 3 / 4, but second build run works Can't remove `console` statements with babel nor terser in vue cli 3 / 4, but second build run works vue.js vue.js

Can't remove `console` statements with babel nor terser in vue cli 3 / 4, but second build run works


I met the same err and i fixed it through adding lintOnSave: process.env.NODE_ENV === 'development' in vue.config.js. The following is the checklist to help u fix ur problem:

  • npx vue-cli-service inspect --mode production >> webpack.config.production.js generate webpack configuration file in production
  • then you can see lint is before terser. It makes the first time yarn build failure and the next time is successful
  • so in this case, you can turn off the lintOnSave in production

About lintOnsave