Browse Source

webpack uglifyjs (not working: max call stack size exceeded)

Bachir Soussi Chiadmi 3 years ago
parent
commit
85eff145d0
1 changed files with 23 additions and 3 deletions
  1. 23 3
      build/webpack.config.prod.js

+ 23 - 3
build/webpack.config.prod.js

@@ -5,21 +5,41 @@ const merge = require('webpack-merge')
 const baseConfig = require('./webpack.config.base')
 const MiniCssExtractPlugin  = require('mini-css-extract-plugin')
 
+// const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
+// ERROR in vendor.js from UglifyJs
+// RangeError: Maximum call stack size exceeded
+
 module.exports = merge(baseConfig, {
   mode: 'production',
   output: {
     publicPath: '/'
   },
   optimization: {
+    // minimizer: [
+    //   new UglifyJSPlugin({
+    //     uglifyOptions: {
+    //       // Eliminate comments
+    //       comments: false,
+    //       // remove warnings
+    //       warnings: false,
+    //       minimize: false,
+    //       mangle: false,
+    //       compress: {
+    //         // Drop console statements
+    //         drop_console: true,
+    //       }
+    //     }
+    //   })
+    // ],
     splitChunks: {
       cacheGroups: {
         commons: {
           test: /[\\/]node_modules[\\/]/,
           name: "vendor",
           chunks: "all",
-        },
-      },
-    },
+        }
+      }
+    }
   },
   module: {
     rules: [