Reference

uglifyjs(1)

JavaScript parser, mangler/compressor and beautifier toolkit

NAME

uglify-js - JavaScript parser, mangler/compressor and beautifier toolkit

SYNOPSIS

uglifyjs [files...] [options]

OPTIONS

-h, --help

Print usage information. `--help options` for details on available options.

-v, -V, --version

Print version number.

-p, --parse <options>

Specify parser options.

-c, --compress [options]

Enable compressor/specify compressor options.

-m, --mangle [options]

Mangle names/specify mangler options.

--mangle-props [options]

Mangle properties/specify mangler options.

-b, --beautify [options]

Beautify output/specify output options.

-O, --output-opts <options>

Output options (beautify disabled).

-o, --output <file>

Output file (default STDOUT).

--annotations

Process and preserve comment annotations.

--no-annotations

Ignore and discard comment annotations.

--comments [filter]

Preserve copyright comments in the output.

--config-file <file>

Read minify() options from JSON file.

-d, --define <expr>[=value]

Global definitions.

-e, --enclose [arg[,...][:value[,...]]]

Embed everything in a big function, with configurable argument(s) & value(s).

--expression

Parse a single expression, rather than a program.

--ie

Support non-standard Internet Explorer.

--keep-fargs

Do not mangle/drop function arguments.

--keep-fnames

Do not mangle/drop function names. Useful for code relying on Function.prototype.name.

--module

Process input as ES module (implies --toplevel)

--name-cache <file>

File to hold mangled name mappings.

--rename

Force symbol expansion.

--no-rename

Disable symbol expansion.

--self

Build UglifyJS as a library (implies --wrap UglifyJS)

--source-map [options]

Enable source map/specify source map options.

--timings

Display operations run time on STDERR.

--toplevel

Compress and/or mangle variables in toplevel scope.

--v8

Support non-standard Chrome & Node.js.

--validate

Perform validation during AST manipulations.

--verbose

Print diagnostic messages.

--warn

Print warning messages.

--webkit

Support non-standard Safari/Webkit.

--wrap <name>

Embed everything as a function with ???exports??? corresponding to ???name??? globally.

(internal debug use only)

--in-situ

Warning: replaces original source files with minified output.

--reduce-test

Reduce a standalone test case (assumes cloned repository).

History

--annotations since Debian 12 (Bookworm); --config-file since Debian 12 (Bookworm); --expression since Debian 12 (Bookworm); --help since Debian 9 (Stretch); --ie since Debian 12 (Bookworm); --in-situ since Debian 12 (Bookworm); --keep-fargs since Debian 12 (Bookworm); --keep-fnames since Debian 9 (Stretch); --mangle-props since Debian 9 (Stretch); --module since Debian 12 (Bookworm); --name-cache since Debian 9 (Stretch); --no-annotations since Debian 12 (Bookworm); --no-rename since Debian 12 (Bookworm); --output-opts since Debian 12 (Bookworm); --parse since Debian 12 (Bookworm); --reduce-test since Debian 12 (Bookworm); --rename since Debian 12 (Bookworm); --timings since Debian 12 (Bookworm); --toplevel since Debian 12 (Bookworm); --v8 since Debian 12 (Bookworm); --validate since Debian 12 (Bookworm); --warn since Debian 12 (Bookworm); --webkit since Debian 12 (Bookworm); -O since Debian 12 (Bookworm); -h since Debian 12 (Bookworm).

--acorn until Debian 11 (Bullseye); --bare-returns until Debian 11 (Bullseye); --dump-spidermonkey-ast until Debian 11 (Bullseye); --export-all until Debian 11 (Bullseye); --expr until Debian 11 (Bullseye); --in-source-map until Debian 11 (Bullseye); --lint until Debian 11 (Bullseye); --mangle-regex until Debian 11 (Bullseye); --noerr until Debian 11 (Bullseye); --preamble until Debian 11 (Bullseye); --prefix until Debian 11 (Bullseye); --pure-funcs until Debian 11 (Bullseye); --quotes until Debian 11 (Bullseye); --reserve-domprops until Debian 11 (Bullseye); --reserved until Debian 11 (Bullseye); --reserved-file until Debian 11 (Bullseye); --screw-ie8 until Debian 11 (Bullseye); --source-map-include-sources until Debian 11 (Bullseye); --source-map-inline until Debian 11 (Bullseye); --source-map-root until Debian 11 (Bullseye); --source-map-url until Debian 11 (Bullseye); --spidermonkey until Debian 11 (Bullseye); --stats until Debian 11 (Bullseye); --support-ie8 until Debian 11 (Bullseye); --wrap-iife until Debian 11 (Bullseye); -q until Debian 11 (Bullseye); -r until Debian 11 (Bullseye).