Products / Developer tools
mni
mni is a Rust command-line minifier built on SWC for JavaScript and LightningCSS for CSS, with JSON support through serde_json. It auto-detects the file format and offers dev, prod and aggressive presets.
cargo install mni- 3
- Formats: JavaScript, CSS, JSON
- 3
- Presets
Features
Built for production
Built on SWC and LightningCSS
Uses SWC for JavaScript (ES5 to ESNext) and LightningCSS for CSS.
Safe by default
Conservative optimizations intended to avoid producing invalid code.
Multi-format
JavaScript, CSS and JSON in one tool.
Smart detection
File format is detected automatically, with a CLI that offers presets.
Source maps
Optional source map generation for debugging.
In code
See it work
mni input.js -o output.min.js
mni styles.css -o styles.min.css
mni data.json -o data.min.json
mni input.js --statsmni input.js --preset dev
mni input.js --preset prod
mni input.js --preset aggressivePresets
- `dev`: fast, readable output with source maps - `prod`: balanced compression and speed - `aggressive`: maximum compression
Optimization techniques
JavaScript (SWC): identifier mangling, dead code elimination, constant folding, scope hoisting and arrow function optimization.
CSS (LightningCSS): color minification, length optimization, property merging, vendor prefix optimization and calc() optimization.
JSON (serde_json): whitespace removal, key ordering and UTF-8 optimization.
Putting mni to work?
We help teams design, build and operate production systems on this stack.