https://github.com/jamsinclair/multi-uglify-js
Simple wrapper around uglify-js to make minifying multiple output files easier
https://github.com/jamsinclair/multi-uglify-js
Last synced: 18 days ago
JSON representation
Simple wrapper around uglify-js to make minifying multiple output files easier
- Host: GitHub
- URL: https://github.com/jamsinclair/multi-uglify-js
- Owner: jamsinclair
- License: mit
- Created: 2021-07-06T09:55:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-18T12:16:02.000Z (almost 4 years ago)
- Last Synced: 2025-02-14T08:35:56.601Z (2 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# multi-uglify-js
> Batch minify multiple JavaScript files on the command line
This is a very loose wrapper around [UglifyJS 3](https://github.com/mishoo/UglifyJS)
It aims to replicate as much of the UglifyJS command line behaviour within reason.
*⚠️ There may be some bugs around advanced usage of uglify options. Please open an issue or PR if encountered*
## Install
```
$ npm install --global multi-uglify-js
```## Usage
```
$ multi-uglifyjs --helpUsage
$ multi-uglifyjs [file globs]Options
--help Print usage information.
--version Print version of multi-uglifyjs lib.-p, --parse Specify parse options:
https://github.com/mishoo/UglifyJS#parse-options-c, --compress [options] Enable compressor/specify compressor options.
Options are comma separated and in the form of: "toplevel,sequences=false"
(The former value is defaulting "toplevel" to a true value.)
https://github.com/mishoo/UglifyJS#compress-options-m, --mangle [options] Mangle names/specify mangler options.
Options are comma separated and in the form of: "eval,reserved=['$','require','exports']"
(The former value is defaulting "eval" to a true value.)
https://github.com/mishoo/UglifyJS#mangle-options--mangle-props [options] Mangle properties/specify mangler options.
Options are comma separated and in the form of: "builtins,reserved=['doNotChange']"
https://github.com/mishoo/UglifyJS#mangle-properties-options-O, --output-opts [options] Specify output options
-o, --output Output file directory
--annotations Process and preserve comment annotations.
(/*@__PURE__*/ or /*#__PURE__*/)--ie Support non-standard Internet Explorer.
Equivalent to setting 'ie: true' in 'minify()'
for 'compress', 'mangle' and 'output' options.
By default UglifyJS will not try to be IE-proof.--keep-fnames Do not mangle/drop function names. Useful for
code relying on Function.prototype.name.--source-map [options] Enable source map/specify source map options
https://github.com/mishoo/UglifyJS#source-map-options--toplevel Compress and/or mangle variables in top level scope.
--v8 Support non-standard Chrome & Node.js
Equivalent to setting 'v8: true' in 'minify()'
for 'mangle' and 'output' options.
By default UglifyJS will not try to be v8-proof.--verbose Print diagnostic messages.
--warn Print warning messages.
--webkit Support non-standard Safari/Webkit.
Equivalent to setting 'webkit: true' in 'minify()'
for 'mangle' and 'output' options.
By default UglifyJS will not try to be Safari-proof.Examples
# Minify all JavaScript files in the assets directory
# and output minified files in place
$ multi-uglifyjs assets/*.js# Minify all JavaScript files in the assets directory
# and output minified files in the dist
$ multi-uglifyjs assets/*.js -o dists# Minify with a different file suffix "-min", becoming "-min.js"
$ multi-uglifyjs assets/*.js --suffix=-min
```