Scroll to navigation

BABEL-MINIFY(1) User Commands BABEL-MINIFY(1)

NAME

babel-minify - ES6+ aware minifier based on the Babel toolchain

DESCRIPTION

Usage: minify index.js [options]
IO Options:
Output to a specific file
Output to a specific directory
Parser/Generator options
Indicate the mode the code should be parsed in. Valid options are "script" | "module" | "unambiguous"
Enable/Disable comments in the output. For more specific control, use the Node API
Transform Options:
Context and scope aware variable renaming
Simplifies code for minification by reducing statements into expressions
Transform boolean literals into !0 for true and !1 for false
Minify standard built-in objects
Inlines consecutive property assignments, array pushes, etc.
Inlines bindings and tries to evaluate expressions.
Tries to evaluate expressions and inline the result. Deals with numbers and strings
Optimize code for repetition-based compression algorithms such as gzip.
Minify Infinity to 1/0
Convert valid member expression property literals into plain identifiers
Merge sibling variables into single variable declaration
Shortening of numeric literals via scientific notation
Transform valid identifier property key literals into identifiers
Change RegExp constructors into literals
Removes all console.* calls
Removes all debugger statements
Removes rval's for variable assignments, return arguments from functions that evaluate to undefined
Replaces matching nodes in the tree with a given replacement node
Convert === and !== to == and != if their types are inferred to be the same
Minify constructors to equivalent version
Transforms undefined into void 0
Other Options:
Preserve Function Name (useful for code depending on fn.name)
Preserve Class Name (useful for code depending on c.name)
Don't remove unused fn arguments (useful for code depending on fn.length)
Detect usages of variables in the Temporal Dead Zone
Nested Options:
To use nested options (plugin specfic options) simply use the pattern --pluginName.featureName.
For example, minify index.js --mangle.keepClassName --deadcode.keepFnArgs --outFile index.min.js
November 2022 babel-minify 0.5.2