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-contrib › uglifyjs-webpack-plugin
GitHub - webpack-contrib/uglifyjs-webpack-plugin: [deprecated] UglifyJS Plugin
December 5, 2019 - Enable file caching. Default path to cache directory: node_modules/.cache/uglifyjs-webpack-plugin.
Starred by 1.4K users
Forked by 177 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
webpack
v4.webpack.js.org › plugins › uglifyjs-webpack-plugin
UglifyjsWebpackPlugin | webpack
({ 'uglify-js': require('uglify-js/package.json').version, // uglify version 'uglifyjs-webpack-plugin': require('../package.json').version, // plugin version 'uglifyjs-webpack-plugin-options': this.options, // plugin options path: compiler.outputPath ?
🌐
npm
npmjs.com › package › uglifyjs-webpack-plugin
uglifyjs-webpack-plugin - npm
July 31, 2019 - ⚠️ Always use require inside minify function when parallel option enabled. ... const { error, map, code, warnings } = require('uglify-module') // Or require('./path/to/uglify-module') ... UglifyJS minify options.
      » npm install uglifyjs-webpack-plugin
    
Published   Jul 31, 2019
Version   2.2.0
Author   webpack Contrib Team
🌐
CodeSandbox
codesandbox.io › examples › package › uglifyjs-webpack-plugin
uglifyjs-webpack-plugin examples - CodeSandbox
Use this online uglifyjs-webpack-plugin playground to view and fork uglifyjs-webpack-plugin example apps and templates on CodeSandbox.
🌐
Pusher
pusher.com › tutorials › webpack-part-5
Getting started with webpack - Part 5: Introduction to plugins | Pusher tutorials
February 14, 2019 - The first plugin we want to install and activate in the project is the UglifyJS plugin. We will be using this plugin to minify the outputted JavaScript. To install this package, run the following command in your terminal: ... When the installation is complete, you can then open the webpack.config.js file and replace the contents with the following code:
🌐
W3cubDocs
docs.w3cub.com › webpack › plugins › uglifyjs-webpack-plugin
UglifyjsWebpackPlugin - Webpack - W3cubDocs
const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { //... optimization: { minimizer: [ new UglifyJsPlugin() ] } }
🌐
GitLab
mit.cs.uchicago.edu › haohsiang › topics-auction › tree › 554719973d1cb2f10f91d34216e8ce363831637c › node_modules › uglifyjs-webpack-plugin
node_modules/uglifyjs-webpack-plugin · 554719973d1cb2f10f91d34216e8ce363831637c · Hao-Hsiang Song / topics-auction
uglifyjs-webpack-plugin · Find file History · Select Archive Format · Source code · Download zip · Download tar.gz · Download tar.bz2 · Download tar · need toString() · 55471997 · Rex Zhou committed Dec 03, 2018 ·
🌐
Stack Overflow
stackoverflow.com › questions › tagged › uglifyjs-webpack-plugin
Newest 'uglifyjs-webpack-plugin' Questions - Stack Overflow
Uglify's "keep_quoted" option seems like it should do what I ... ... I want to minify my files using uglifyjs-webpack. For example I have a source file core/js/test and want to minify it and send it to min/js/test.
Find elsewhere
🌐
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
🌐
npm
npmjs.com › package › webpack-uglify-js-plugin
webpack-uglify-js-plugin - npm
August 11, 2016 - var webpackUglifyJsPlugin = require('webpack-uglify-js-plugin'); new webpackUglifyJsPlugin({ cacheFolder: path.resolve(__dirname, 'public/cached_uglify/'), debug: true, minimize: true, sourceMap: false, output: { comments: false }, compressor: { warnings: false } })
      » npm install webpack-uglify-js-plugin
    
Published   Aug 11, 2016
Version   1.1.9
Author   pychen
🌐
GitHub
github.com › noBlubb › uglify-es-webpack-plugin
GitHub - noBlubb/uglify-es-webpack-plugin: UglifyJS3 with ES6 plugin for webpack
// webpack.config.js const UglifyEsPlugin = require('uglify-es-webpack-plugin'); if (process.env.NODE_ENV === 'production') { module.exports.devtool = 'source-map'; module.exports.plugins = (module.exports.plugins || []).concat([ new UglifyEsPlugin({ uglify-es options }) ]); } Supports source maps using devtool = 'source-map' - others untested. Make sure to not use -p anymore, as it will try to use the built-in UglifyJs plugin.
Starred by 17 users
Forked by 4 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
npm
npmjs.com › package › @sandfox › uglifyjs-webpack-plugin
@sandfox/uglifyjs-webpack-plugin - npm
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); module.exports = { entry: {...}, output: {...}, module: {...}, plugins: [ new UglifyJSPlugin() ] }; This plugin supports UglifyJS features as discussed below: mangle (boolean|object) - Passing true or an object enables and provides options for UglifyJS name mangling. See UglifyJS documentation for mangle options. Example configuration, this will not mangle properties (see below):
      » npm install @sandfox/uglifyjs-webpack-plugin
    
🌐
Medium
medium.com › front-end-weekly › webpack-by-example-part-1-1d07bc42006a
webpack By Example: Part 1. webpack (apparently always written in… | by John Tucker | Frontend Weekly | Medium
June 9, 2018 - Executing the command ./node_modules/.bin/webpack -p will create an updated main.bundle.js. Reloading the index.html file will now only display hello world in the developer console; the unreachable code was minified away by the UglifyJS Webpack Plugin.
🌐
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 - index: don't pass compilation as an argument to UglifyJsPlugin.buildError (#201) (339ca10) package: use exact uglify-es version (dependencies) (#199) (#202) (426bafd) package: use exact uglify-es version (dependencies) (#199) (2e2ed36) ... Enforces peerDependencies of "webpack": ">= 3.0.0-rc.0 || ^3.0.0".
Author   webpack-contrib
🌐
npm
npmjs.com › package › uglifyjs-3-webpack-plugin
uglifyjs-3-webpack-plugin - npm
Latest version: 1.2.4, last published: 8 years ago. Start using uglifyjs-3-webpack-plugin in your project by running `npm i uglifyjs-3-webpack-plugin`. There are 3 other projects in the npm registry using uglifyjs-3-webpack-plugin.
      » npm install uglifyjs-3-webpack-plugin
    
Published   Apr 12, 2018
Version   1.2.4
Author   webpack Contrib Team
🌐
Netlify
competent-wiles-ed53ea.netlify.app › plugins › uglifyjs-webpack-plugin
UglifyjsWebpackPlugin
const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { plugins: [ new UglifyJsPlugin() ] }
🌐
Npm
npm.io › package › uglifyjs-webpack-plugin
Uglifyjs-webpack-plugin NPM | npm.io
({ 'uglify-js': require('uglify-js/package.json').version, // uglify version 'uglifyjs-webpack-plugin': require('../package.json').version, // plugin version 'uglifyjs-webpack-plugin-options': this.options, // plugin options path: compiler.outputPath ?