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

Answer from Sam Chen on Stack Overflow
🌐
GitHub
github.com › webpack › webpack › issues › 7923
Switch from uglifyjs-webpack-plugin (uglify-es) to terser-webpack-plugin (terser) · Issue #7923 · webpack/webpack
August 20, 2018 - What is motivation or use case for adding/changing the behavior? uglifyjs-webpack-plugin uses uglify-es which is no longer maintained, and has been replaced by a fork called terser.
Author   edmorley
🌐
npm Trends
npmtrends.com › uglify-js-vs-uglifyjs-webpack-plugin
uglify-js vs uglifyjs-webpack-plugin | npm trends
Comparing trends for uglify-js 3.19.3 which has 25,805,916 weekly downloads and 13,340 GitHub stars vs. uglifyjs-webpack-plugin 2.2.0 which has 863,110 weekly downloads and 1,382 GitHub stars.
🌐
StackShare
stackshare.io › stackups › uglifyjs-vs-webpack
UglifyJS vs Webpack | What are the differences?
UglifyJS - A JavaScript parser, minifier, compressor and beautifier toolkit.. Webpack - A bundler for javascript and friends.
🌐
Stackshare
stackshare.io › uglifyjs › alternatives
What are some alternatives to UglifyJS? - StackShare
Pros include flexibility and extensive plugin ecosystem, but one of the cons may be a more complex setup compared to UglifyJS. Babili: Babili is a Babel preset for optimizing and minifying JavaScript code. It focuses on providing a lightweight, easy-to-use solution for code minification. Pros include easy integration with Babel and simplified minification process, but one of the cons may be limited advanced optimization compared to UglifyJS. terser-webpack-plugin: Terser-webpack-plugin is a webpack plugin that utilizes Terser for JavaScript code optimization and minification.
🌐
Stackshare
stackshare.io › npm-uglifyjs-webpack-plugin › alternatives
uglifyjs-webpack-plugin Alternatives
Explore the pros & cons of uglifyjs-webpack-plugin and its alternatives. Learn about popular competitors like jQuery, React, and AngularJS
🌐
LogRocket
blog.logrocket.com › home › terser vs. uglify vs. babel-minify: comparing javascript minifiers
Terser vs. Uglify vs. babel-minify: Comparing JavaScript minifiers - LogRocket Blog
June 4, 2024 - In this tutorial, we’ll introduce ... We’ll explain why Terser is more performant and demonstrate how to use the Terser webpack plugin, as well as webpack plugins for UglyJS and babel-minify....
🌐
GitHub
github.com › webpack-contrib › terser-webpack-plugin › issues › 15
Terser vs. UglifyJS - Dramatic Improvements · Issue #15 · webpack/terser-webpack-plugin
September 14, 2018 - So Terser seems to speed it up by 3x and since it took me just about 2 minutes to switch from UglifyJS it seems almost too good to be true.
Author   anton164
Find elsewhere
🌐
webpack
webpack.js.org › plugins › terser-webpack-plugin
TerserWebpackPlugin | webpack
Disclaimer: TerserWebpackPlugin is a third-party package maintained by community members, it potentially does not have the same support, security policy or license as webpack, and it is not maintained by webpack.
🌐
SurviveJS
survivejs.com › books › webpack › optimizing › minifying
Survivejs
Since webpack 4, the production output gets minified using terser↗ by default. Terser is an ES2015+ compatible JavaScript-minifier. Compared to UglifyJS, the earlier standard for many projects, it’s a future-oriented option.
🌐
npm Trends
npmtrends.com › jsmin-vs-minify-vs-terser-vs-uglify-js-vs-uglifyjs-webpack-plugin
jsmin vs minify vs terser vs uglify-js vs uglifyjs-webpack-plugin | npm trends
Comparing trends for jsmin 1.0.1 which has 54,957 weekly downloads and 52 GitHub stars vs. minify 14.1.0 which has 27,242 weekly downloads and 246 GitHub stars vs. terser 5.44.0 which has 40,638,043 weekly downloads and 9,125 GitHub stars vs. uglify-js 3.19.3 which has 27,449,803 weekly downloads and 13,368 GitHub stars vs. uglifyjs-webpack-plugin 2.2.0 which has 677,174 weekly downloads and 1,380 GitHub stars.
🌐
GitHub
github.com › webpack-contrib › uglifyjs-webpack-plugin
GitHub - webpack-contrib/uglifyjs-webpack-plugin: [deprecated] UglifyJS Plugin
December 5, 2019 - [deprecated] UglifyJS Plugin. Contribute to webpack-contrib/uglifyjs-webpack-plugin development by creating an account on GitHub.
Starred by 1.4K users
Forked by 177 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
LibHunt
libhunt.com › r › uglifyjs-webpack-plugin
Uglifyjs-webpack-plugin Alternatives and Reviews
Which is the best alternative to uglifyjs-webpack-plugin? Based on common mentions it is: Quine-relay and Pentaquine
🌐
GitHub
github.com › webpack-contrib › uglifyjs-webpack-plugin › releases
Releases · webpack-contrib/uglifyjs-webpack-plugin
December 5, 2019 - Switch back to uglify-js (uglify-es is abandoned, if you need uglify ES6 code please use terser-webpack-plugin).
Author   webpack-contrib
🌐
GitHub
github.com › webpack-contrib › uglifyjs-webpack-plugin › blob › master › CHANGELOG.md
uglifyjs-webpack-plugin/CHANGELOG.md at master · webpack-contrib/uglifyjs-webpack-plugin
December 5, 2019 - Switch back to uglify-js (uglify-es is abandoned, if you need uglify ES6 code please use terser-webpack-plugin).
Author   webpack-contrib
🌐
DEV Community
dev.to › felipecarrillo100 › comment › 5kk3
I need to modify the uglifyOptions from the UglifyJSPlugin, any idea how to ... - DEV Community
September 22, 2018 - Since this commit they are using TerserPlugin instead of UglifyJsPlugin. In current implementation you cannot override the instance of a specific plugin inside minimizer array. Plugins merge was implemented for plugins array but not for the rest. If you'd like this functionality to be added, please open a feature request on github.