Installations
npm install uglifyjs-webpack-plugin3
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>= 4.3 < 5.0.0 || >= 5.10
Node Version
8.1.2
NPM Version
5.3.0
Score
36.7
Supply Chain
79.8
Quality
63.9
Maintenance
50
Vulnerability
96.2
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
webpack-contrib
Download Statistics
Total Downloads
89,590
Last Day
1
Last Week
7
Last Month
29
Last Year
323
GitHub Statistics
MIT License
1,382 Stars
223 Commits
179 Forks
30 Watchers
4 Branches
66 Contributors
Updated on Jan 16, 2025
Package Meta Information
Latest Version
1.0.0-beta
Package Id
uglifyjs-webpack-plugin3@1.0.0-beta
Size
9.96 kB
NPM Version
5.3.0
Node Version
8.1.2
Total Downloads
Cumulative downloads
Total Downloads
89,590
Last Day
0%
1
Compared to previous day
Last Week
-41.7%
7
Compared to previous week
Last Month
190%
29
Compared to previous month
Last Year
-17%
323
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
ℹ️ webpack contains the same plugin under
webpack.optimize.UglifyJsPlugin
. The documentation is valid apart from the installation instructions
Install
1npm i -D uglifyjs-webpack-plugin
Usage
webpack.config.js
1const UglifyJSPlugin = require('uglifyjs-webpack-plugin') 2 3module.exports = { 4 plugins: [ 5 new UglifyJSPlugin() 6 ] 7}
Options
Name | Type | Default | Description |
---|---|---|---|
test | {RegExp|Array<RegExp>} | /.js($|?)/i | Test to match files against |
include | {RegExp|Array<RegExp>} | undefined | Files to include |
exclude | {RegExp|Array<RegExp>} | undefined | Files to exclude |
parallel | {Boolean|Object} | false | Use multi-process parallel running and file cache to improve the build speed |
sourceMap | {Boolean} | false | Use source maps to map error message locations to modules (This slows down the compilation) ⚠️ cheap-source-map options don't work with this plugin |
uglifyOptions | {Object} | {...defaults} | uglify Options |
extractComments | {Boolean|RegExp|Function<(node, comment) -> {Boolean|Object}>} | false | Whether comments shall be extracted to a separate file, (see details (webpack >= 2.3.0 ) |
warningsFilter | {Function(source) -> {Boolean}} | `` | Allow to filter uglify warnings |
test
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 test: /\.js($|\?)/i 4 }) 5]
include
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 include: /\/includes/ 4 }) 5]
exclude
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 exclude: /\/excludes/ 4 }) 5]
parallel
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 parallel: true 4 }) 5]
Name | Type | Default | Description |
---|---|---|---|
cache | {Boolean} | node_modules/.cache/uglifyjs-webpack-plugin | Enable file caching |
workers | {Boolean|Object} | os.cpus().length - 1 | Number of concurrent runs, default is the maximum |
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 parallel: { 4 cache: true 5 workers: 2 // for e.g 6 } 7 }) 8]
ℹ️ Parallelization can speedup your build significantly and is therefore highly recommended
sourceMap
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 sourceMap: true 4 }) 5]
⚠️
cheap-source-map
options don't work with this plugin
uglifyOptions
Name | Type | Default | Description |
---|---|---|---|
ie8 | {Boolean} | false | Enable IE8 Support |
ecma | {Number} | undefined | Supported ECMAScript Version (5 , 6 , 7 or 8 ). Affects parse , compress && output options |
parse | {Object} | {} | Additional Parse Options |
mangle | {Boolean|Object} | true | Enable Name Mangling (See Mangle Properties for advanced setups, use with ⚠️) |
output | {Object} | {} | Additional Output Options (The defaults are optimized for best compression) |
compress | {Boolean|Object} | true | Additional Compress Options |
warnings | {Boolean} | false | Display Warnings |
webpack.config.js
1[ 2 new UglifyJSPlugin({ 3 uglifyOptions: { 4 ie8: false, 5 ecma: 8, 6 parse: {...options}, 7 mangle: { 8 ...options, 9 properties: { 10 // mangle property options 11 } 12 }, 13 output: { 14 comments: false, 15 beautify: false, 16 ...options 17 }, 18 compress: {...options}, 19 warnings: false 20 } 21 }) 22]
extractComments
{Boolean}
All comments that normally would be preserved by the comments
option will be moved to a separate file. If the original file is named foo.js
, then the comments will be stored to foo.js.LICENSE
{RegExp|String}
or {Function<(node, comment) -> {Boolean}>}
All comments that match the given expression (resp. are evaluated to true
by the function) will be extracted to the separate file. The comments
option specifies whether the comment will be preserved, i.e. it is possible to preserve some comments (e.g. annotations) while extracting others or even preserving comments that have been extracted.
{Object}
Name | Type | Default | Description |
---|---|---|---|
condition | {Regex|Function} | `` | Regular Expression or function (see previous point) |
filename | {String|Function} | compilation.assets[file] | The file where the extracted comments will be stored. Can be either a {String} or a {Function<(string) -> {String}>} , which will be given the original filename. Default is to append the suffix .LICENSE to the original filename |
banner | {Boolean|String|Function} | /*! For license information please see ${filename}.js.LICENSE */ | The banner text that points to the extracted file and will be added on top of the original file. Can be false (no banner), a {String} , or a {Function<(string) -> {String} that will be called with the filename where extracted comments have been stored. Will be wrapped into comment |
warningsFilter
webpack.config.js
1[ 2 new UglifyJsPlugin({ 3 warningsFilter: (src) => true 4 }) 5]
Maintainers
![]() Steven Hargrove |
![]() Juho Vepsäläinen |
![]() Joshua Wiens |
![]() Michael Ciniawsky |
![]() Alexander Krasnoyarov |

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 22 are checked with a SAST tool
Reason
74 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh
- Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-7xcx-6wjh-7xp2
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.1
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More