Oxc Minifier Alpha
Nos complace anunciar un lanzamiento alfa para oxc-minifyNos complace anunciar un lanzamiento alfa para `oxc-minify'.
QUERY LENGTH LIMIT EXCEEDED. MAX ALLOWED QUERY : 500 CHARS
Comparing widely-used minifiers on typescript.js:
| Artifact | Original size | Gzip size | |
|---|---|---|---|
| typescript v4.9.5 (Source) | 10.95 MB | 1.88 MB | |
| Minifier | Minified size | Minzipped size | Time |
| @swc/core | 🏆-70% 3.32 MB | 🏆-54% 858.29 kB | 5x2,179 ms |
| oxc-minify | -69% 3.35 MB | -54% 860.67 kB | 🏆 444 ms |
| terser (no compress) | -68% 3.53 MB | -53% 879.30 kB | 14x6,433 ms |
| esbuild | -68% 3.49 MB | -51% 915.55 kB | 1x492 ms |
| terser ❌ Timed out | - | - | ⚠️ +10,000 ms |
oxc-minify Usage Example
typescript
import { minify } from "oxc-minify";
const filename = "test.js";
const code = "const x = 'a' + 'b'; console.log(x);";
const options = {
compress: {
target: "esnext",
},
mangle: {
toplevel: false,
},
codegen: {
removeWhitespace: true,
},
sourcemap: true,
};
const result = minify(filename, code, options);
console.log(result.code);
console.log(result.map);