title: Setting the TerserWebpackPlugin webpack plugin's source map option to true significantly increases webpack build time
body: <p>I'm setting source-maps to be on production. I'm using  TerserWebpackPlugin to minify my js(which appears to be the default one according to the webpack docs). This plugin has a config option for <code>sourceMap</code>, which from the docs it appears you have to enable for best practices(but I'm not 100% sure although it does work without it). The thing is, when it's set to true the option adds an extra 12ish minutes to build time(from around 1:15 mins to 13ish mins). An extra 12 mins of build time being added feels a bit much so I'm guessing when <code>sourceMap: true</code> it parses the source maps however source maps are only downloaded once a user opens their dev tools so I'm wondering if this is even needed.</p>
  
  <p>My question is, is this config required? And if so, is possible to speed up the build process any?</p>
  
  <p>Here's my configs by the way:</p>
  
  <p>webpack.common.js</p>
  
  <pre><code>const path = require('path');
  const webpack = require('webpack');
  const CleanWebpackPlugin = require('clean-webpack-plugin');
  const WEBPACK_OUTPUT_PATH = path.resolve(`${__dirname}/webpack_output`);
  module.exports = {
    entry: { ... },
    output: {
      path: WEBPACK_OUTPUT_PATH,
      filename: '[name]_bundle.js',
    },
    module: { ... },
    plugins: [
      new CleanWebpackPlugin([WEBPACK_OUTPUT_PATH]),
      new webpack.DefinePlugin({
        'global.BUILD_NUMBER': Date.now(),
      }),
    ],
    resolve: {
      alias: {
        ...
      },
      extensions: ['.js', '.jsx', '.json', '.scss', 'css'],
    },
    watchOptions: {
      poll: true,
      ignored: /node_modules/,
    },
  };
  </code></pre>
  
  <p>webpack.prod.js</p>
  
  <pre><code>const webpack = require('webpack');
  const merge = require('webpack-merge');
  const TerserPlugin = require('terser-webpack-plugin');
  const common = require('./webpack.common.js');
  module.exports = merge(common, {
    // NOTE: There are internal webpack plugins that are used when production mode is enabled so they
    // are not defined below. Read more about them here: https://webpack.js.org/plugins/internal-plugins/
    mode: 'production',
    devtool: 'source-map', 
    performance: {
      hints: 'warning',
    },
    output: {
      pathinfo: false,
    },
    optimization: {
      namedModules: false,
      namedChunks: false,
      nodeEnv: 'production', 
      flagIncludedChunks: true,
      occurrenceOrder: true,
      concatenateModules: true,
      splitChunks: {
        hidePathInfo: true,
        minSize: 30000,
        maxAsyncRequests: 5,
        maxInitialRequests: 3,
      },
      noEmitOnErrors: true,
      checkWasmTypes: true,
      minimize: true,
    },
    plugins: [
      new TerserPlugin({
        sourceMap: true,
      }),
      new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
      new webpack.optimize.ModuleConcatenationPlugin(),
      new webpack.NoEmitOnErrorsPlugin(),
    ],
  });
  </code></pre>