Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UglifyJS and webpack v5

We've been using UglifyJS and webpack v4 for our react code, but then just updated to webpack v5. It appears that UglifyJS does not work with webpack v5. Is there an alternative? We need something that works with babel-loader.

Thanks

like image 602
vgoklani Avatar asked Sep 10 '25 17:09

vgoklani


1 Answers

Webpack 5 comes with terser-webpack-plugin out of the box, hence you can just import it and configure as you wish.

like image 55
chenxsan Avatar answered Sep 13 '25 16:09

chenxsan