M+Minify++
Reference

CLI reference

Choose files, choose a JavaScript optimisation contract when you need one, and choose whether output stays beside the source or replaces it.

Basic form

minify [--in-place|-i] [--structured|--aggressive] \
       [--mangle-top-level] [--structured-jsx-expressions] \
       [--mangle-property=NAME] file [file ...]

Default sibling output

minify public/app.js
# writes public/app.min.js

If the source already has a final extension, .min is inserted before it. Conservative mode is the default.

JavaScript optimisation levels

ConservativeDefault lexical/context-aware minification with no opt-in binding rewrite.
Structured--structured enables proven-safe binding renames using scope and reference analysis.
Aggressive--aggressive enables the explicit bounded compression contract in addition to structured analysis.
Closed-world options--mangle-top-level and --mangle-property=NAME require the caller to own the relevant API boundary.
minify --structured app.js
minify --aggressive bundle.js
minify --structured --mangle-top-level closed-world.js
minify --aggressive --mangle-property=_private bundle.js

--structured-jsx-expressions allows the same proven binding work inside JSX expression regions that Minify++ can fully classify; markup remains outside that rewrite contract.

In-place mode

minify --in-place public/app.js
minify -i public/app.js

Minify++ prepares a complete sibling temporary output before replacing an existing regular file, preserves permission bits and rejects symbolic-link destinations. A failed transform or write therefore does not truncate the previous file.

Multiple files

minify index.html assets/site.css assets/app.js data/catalog.json

Each file is minified according to its own extension. JavaScript optimization options apply where relevant; other formats keep their format-specific conservative contract.

Version and help

minify --version
minify --help

The latest tagged release is 1.1.3; the repository currently identifies the next development line as 1.1.4.

Directory workflows

The CLI accepts named regular files, not directories. Let your shell, task runner or build system discover files and pass those paths to minify. Dependency graphs, compilation and deployment policy remain outside Minify++.

Failure behavior

  • Unreadable inputs are errors, not empty files.
  • Unknown extensions and options fail clearly.
  • Malformed supported input returns a format-attributed failure where the mode validates it.
  • Existing directories, symbolic links and other non-regular destinations are not silently replaced.
  • Multiple files are processed independently; the command returns failure if any item fails, so earlier successful outputs may exist.

What is not currently a CLI feature

There is no recursive directory mode, glob expansion, stdin/stdout filter mode, configuration file, watch process, bundling graph or plugin loader. Shell expansion and build orchestration remain external.