title: Vue CLI 3 remove console.log and code comments with Terser
body: <p>I'm using VUE CLI 3 and I need to remove the <em>console.log</em> and <em>code comments</em> from the production built. This is my <a href="https://github.com/terser/terser" rel="nofollow noreferrer">Terser</a> setup:</p>
  <p><strong>webpack.config.js</strong> in <strong>src</strong> folder</p>
  <pre><code>    module.exports = {
  mode: 'production',
    optimization: {
      minimize: true,
      minimizer: [
        new TerserPlugin({
          terserOptions: {
            ecma: undefined,
            warnings: false,
            parse: {},
            compress: {drop_debugger},
            mangle: true, // Note `mangle.properties` is `false` by default.
            module: false,
            output: null,
            toplevel: false,
            nameCache: null,
            ie8: false,
            keep_classnames: undefined,
            keep_fnames: false,
            safari10: false,
          },
        }),
      ],
    },
  };
  </code></pre>
  <p>My production workflow: Run <code>npm run build</code> -&gt; <code>cd dist</code> -&gt; <code>npm run serve</code></p>
  <p>The production build still outputs all <em>console.log</em> statements and shows code comments <code>(&lt;!-- --&gt;)</code>.
  What do I need to change to remove them?</p>