Binato/tooling/mangle.ts
2023-09-10 12:59:22 +01:00

10 lines
No EOL
282 B
TypeScript

import { readFileSync, writeFileSync } from "fs";
import { minify } from "terser";
(async () => {
const mangled = await minify(readFileSync("./build/combined.js").toString(), {
mangle: true,
toplevel: true,
});
writeFileSync("./build/index.min.js", `${mangled.code}`);
})();