title: Use latest terser-webpack-plugin with Webpack5
body: <p>According to this link <a href="https://webpack.js.org/plugins/terser-webpack-plugin/#terseroptions" rel="noreferrer">(Terser documentation)</a> if you are using latest Webpack 5, you don't need to install the Terser plugin as it is included in Webpack 5 out of the box. However, I am having a hard time to get this working.</p>
  <p>If I remove the <code>terser-webpack-plugin</code> from my <code>packages.json</code> file and I try to use it like this (see below webpack.production.js), I get build errors like this:</p>
  <blockquote>
  <p>[webpack-cli] Failed to load 'D:\Project\React\MyApp\config\webpack.production.js' config</p>
  </blockquote>
  <blockquote>
  <p>[webpack-cli] Error: Cannot find module 'terser-webpack-plugin'</p>
  </blockquote>
  <p><strong>webpack.production.js</strong></p>
  <pre><code>const TerserPlugin = require('terser-webpack-plugin');
  const webpack = require('webpack');
  const { merge } = require('webpack-merge');
  
  module.exports = merge(commonCfg, {
          ......
          optimization: {
              minimize: true,
              minimizer: [new TerserPlugin({
                  cache: false,
                  parallel: false,
                  sourceMap: true,
              })]
          },
  </code></pre>
  <p>Now, if I include the latest <code>terser-webpack-plugin</code> version (5.1.1) on my <code>package.json</code> and run my build, I get the following error message:</p>
  <blockquote>
  <p>[webpack-cli] Failed to load 'D:\Project\React\MyApp\config\webpack.production.js' config</p>
  </blockquote>
  <blockquote>
  <p>[webpack-cli] Invalid options object. Terser Plugin has been
  initialized using an options object that does not match the API
  schema.</p>
  <ul>
  <li>options has an unknown property 'sourceMap'. These properties are valid:    object { test?, include?, exclude?, terserOptions?,
  extractComments?, parallel?, minify? }</li>
  </ul>
  </blockquote>
  <p>The only way I can make this work is keeping <code>terser-webpack-plugin</code> on version 4.2.X.</p>
  <p>Is there a way I can make this work with latest Terser version? Or maybe I misunderstood the documentation?</p>