MERN-boilerplate icon indicating copy to clipboard operation
MERN-boilerplate copied to clipboard

Error: webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead.

Open xeroneon opened this issue 6 years ago • 3 comments

when i try to go live on heroku i get this error, unfortunately i dont know much about webpack yet so i have no clue how to resolve this issue

xeroneon avatar Sep 21 '18 15:09 xeroneon

I fixed mine. This message is caused by the updated version of UglifyJS. They removed that function. Install this package here. https://github.com/webpack-contrib/uglifyjs-webpack-plugin Replace the old block of code Open config/webpack.prod.js [top] ... const UglifyJsPlugin = require("uglifyjs-3-webpack-plugin"); ...

plugins: [ new UglifyJsPlugin({ uglifyOptions: { warnings: false, ie8: false, output: { comments: false } } }) ]

frankthoeny avatar Nov 03 '18 20:11 frankthoeny

Any update on this?

PrathamDogra avatar Jun 28 '19 10:06 PrathamDogra

@PrathamDogra

Optimization Since version 4 webpack runs optimizations for you depending on the chosen mode, still all optimizations are available for manual configuration and overrides.

To fix this:

module.exports = {
  optimization: {
    minimize: false //Update this to true or false
  }
};

dajanvulaj avatar Jul 12 '19 09:07 dajanvulaj