UglifyJS2
UglifyJS2 is a JavaScript code minifier and compressor that is part of the UglifyJS project. It processes JavaScript source code to remove whitespace, shorten identifiers, and apply various optimizations in order to reduce file size for distribution. The tool comprises a compressor, a mangler, and an AST-based pipeline for parsing, transforming, and code generation.
UglifyJS2 was developed as a rewrite of the original UglifyJS to provide improved support for newer JavaScript
Key features include dead code elimination, function inlining, constant folding, and scope-aware name mangling. It supports
Typical usage involves the command line, for example: uglifyjs input.js -o output.min.js -c -m. Programmatic use