bufferStuff/tooling/mangle.ts

10 lines
275 B
TypeScript
Raw Normal View History

2023-10-24 12:04:07 +01:00
import { readFileSync, writeFileSync } from "fs";
import { minify } from "terser";
(async () => {
const mangled = await minify(readFileSync("./lib/index.js").toString(), {
mangle: true,
toplevel: true,
});
writeFileSync("./lib/index.min.js", `${mangled.code}`);
})();