title: Webpack - UglifyJs RangeError: Maximum call stack size exceeded
body: <p>I got a legacy vue.js project with webpack: 4.44.1</p>
  <p>When I launching build command
  <code>webpack --config webpack.config.prod.js --progress</code>
  It's started to the building, and throw an error on 92%</p>
  <pre><code>ERROR in assets/js/common.js from UglifyJs RangeError: Maximum call stack size exceeded
  </code></pre>
  <p>How can I fix that error? I saw that guys launch node build with max-callstack parameter, but I don't know is there some similar params on webpack?</p>
  <p>My package:</p>
  <pre><code>    {
    &quot;name&quot;: &quot;webpack-starter&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;Webpack-starter project&quot;,
    &quot;main&quot;: &quot; &quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;webpack-dev-server --config webpack.config.dev.js&quot;,
      &quot;build&quot;: &quot;webpack --config webpack.config.prod.js --progress&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;autoprefixer&quot;: &quot;^8.6.5&quot;,
      &quot;babel-core&quot;: &quot;^6.26.3&quot;,
      &quot;babel-loader&quot;: &quot;^7.1.5&quot;,
      &quot;babel-preset-env&quot;: &quot;^1.7.0&quot;,
      &quot;babel-preset-stage-1&quot;: &quot;^6.24.1&quot;,
      &quot;copy-webpack-plugin&quot;: &quot;^4.5.2&quot;,
      &quot;css-loader&quot;: &quot;^1.0.0&quot;,
      &quot;extract-text-webpack-plugin&quot;: &quot;^3.0.2&quot;,
      &quot;html-webpack-plugin&quot;: &quot;^3.2.0&quot;,
      &quot;mini-css-extract-plugin&quot;: &quot;^0.4.5&quot;,
      &quot;node-sass&quot;: &quot;^4.9.2&quot;,
      &quot;optimize-css-assets-webpack-plugin&quot;: &quot;^5.0.0&quot;,
      &quot;postcss-loader&quot;: &quot;^2.1.6&quot;,
      &quot;sass-loader&quot;: &quot;^7.0.3&quot;,
      &quot;style-loader&quot;: &quot;^0.21.0&quot;,
      &quot;vue-loader&quot;: &quot;15.2.4&quot;,
      &quot;vue-template-compiler&quot;: &quot;^2.5.17&quot;,
      &quot;webpack-cli&quot;: &quot;^3.0.8&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.11.0&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@tanem/svg-injector&quot;: &quot;^8.0.27&quot;,
      &quot;axios&quot;: &quot;^0.19.2&quot;,
      &quot;babel-polyfill&quot;: &quot;^6.26.0&quot;,
      &quot;body-scroll-lock&quot;: &quot;^2.6.4&quot;,
      &quot;countup.js&quot;: &quot;^2.0.4&quot;,
      &quot;jquery&quot;: &quot;^3.3.1&quot;,
      &quot;slick-carousel&quot;: &quot;^1.8.1&quot;,
      &quot;svg-injector&quot;: &quot;^1.1.3&quot;,
      &quot;uglifyjs-webpack-plugin&quot;: &quot;^2.2.0&quot;,
      &quot;vue&quot;: &quot;^2.5.17&quot;,
      &quot;vue-countup-v2&quot;: &quot;^4.0.0&quot;,
      &quot;vue-dragscroll&quot;: &quot;^1.10.0&quot;,
      &quot;vue-masked-input&quot;: &quot;^0.5.2&quot;,
      &quot;vue-perfect-scrollbar&quot;: &quot;^0.2.0&quot;,
      &quot;vue-resize&quot;: &quot;^0.4.5&quot;,
      &quot;vue-router&quot;: &quot;^3.0.1&quot;,
      &quot;vue-slick&quot;: &quot;^1.1.15&quot;,
      &quot;vuelidate&quot;: &quot;^0.7.4&quot;,
      &quot;vuex&quot;: &quot;^3.0.1&quot;,
      &quot;webpack&quot;: &quot;^4.44.1&quot;
    }
  }
  </code></pre>
  <p>and production webpack config (<code>webpack.config.prod.js</code>)</p>
  <pre><code>process.env.NODE_ENV = 'production';
  
  const path = require(&quot;path&quot;);
  const webpack = require(&quot;webpack&quot;);
  const UglifyJsPlugin = require(&quot;uglifyjs-webpack-plugin&quot;);
  const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
  const CopyWebpackPlugin = require(&quot;copy-webpack-plugin&quot;);
  let Config = require(&quot;./webpack.config.js&quot;);
  
  Config.devtool = &quot;cheap-source-map&quot;;
  
  Config.mode = 'production';
  
  Config.optimization = {
      minimizer: [
          new UglifyJsPlugin(),
          new OptimizeCSSAssetsPlugin({})
      ]
  };
  
  Config.plugins = (Config.plugins || []).concat([
      new CopyWebpackPlugin([
          {
              from: path.resolve(__dirname, &quot;./assets/&quot;),
              to: path.resolve(__dirname, &quot;../Bs.WebApp/wwwroot/assets/&quot;)
          }
      ])
  ]);
  
  module.exports = Config;
  </code></pre>