Minifier
TIP
oxc-minify is currently in alpha and may still have bugs. We recommend thoroughly testing its output before deploying to production environments.
Features
- Eliminate dead code.
- Transforms syntaxes to make the output shorter and repetitive.
- Mangle variable names.
- Remove whitespace and comments.
Assumptions
To allow better optimizations, Oxc minifier makes some assumptions about your code. See Assumptions document for more information.
Installation
With Rolldown
If you are using Rolldown, oxc-minify will be used for minification by default. No extra installation is required.
Node.js
- Use the node binding oxc-minify.
- Try on stackblitz.
Rust
Use the umbrella crate oxc with the minifier feature.
Rust usage example can be found here.