minify-js
Extremely fast JavaScript minifier, written in Rust.
Currently under development, with the goal to be similar in effectiveness to common minifiers including esbuild and terser. Improvements and suggestions welcome!
Goals
- Fully written in Rust for maximum compatibility with Rust programs and FFI libraries.
- Maximises performance on a single CPU core for simple efficient scaling and easy compatible integration.
- Minification of individual inputs/files only; no bundling or transforming.
- Prefer minimal complexity and faster performance over maximum configurability and minimal extra compression.
Usage
Add the dependency:
[]
= "0.0.2"
Call the method:
use BufWriter;
use minify;
let mut code: & = b"let x = 1;";
let mut out = new;
minify.unwrap;
assert_eq!;
In progress
- Minify identifiers.
- Combine and reorder declarations.
- Omit more semicolons, spaces, parentheses, and braces.
- More extensive testing, especially over rare syntax.