keithweaver / MERN-boilerplate

MERN stack project boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

xeroneon opened this issue · 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

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
}
}
})
]

Any update on this?

@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
  }
};