Gathering detailed insights and metrics for uglifyjs-webpack-plugin3
Gathering detailed insights and metrics for uglifyjs-webpack-plugin3
npm install uglifyjs-webpack-plugin3
Typescript
Module System
Min. Node Version
Node Version
NPM Version
36.7
Supply Chain
79.8
Quality
63.9
Maintenance
50
Vulnerability
96.2
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
89,590
Last Day
1
Last Week
7
Last Month
29
Last Year
323
MIT License
1,382 Stars
223 Commits
179 Forks
30 Watchers
4 Branches
66 Contributors
Updated on Jan 16, 2025
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
Cumulative downloads
Total Downloads
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
1
ℹ️ webpack contains the same plugin under
webpack.optimize.UglifyJsPlugin
. The documentation is valid apart from the installation instructions
1npm i -D uglifyjs-webpack-plugin
webpack.config.js
1const UglifyJSPlugin = require('uglifyjs-webpack-plugin') 2 3module.exports = { 4 plugins: [ 5 new UglifyJSPlugin() 6 ] 7}
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]
![]() 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
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
74 existing vulnerabilities detected
Details
Score
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