mc-beta-server/tooling/mangle.ts

10 lines
310 B
TypeScript
Raw Permalink Normal View History

import { readFileSync, writeFileSync } from "fs";
import { minify } from "terser";
(async () => {
2023-11-02 10:40:46 +00:00
const mangled = await minify(readFileSync("./build/index.js").toString(), {
mangle: true,
toplevel: true,
});
2023-11-02 10:40:46 +00:00
writeFileSync("./build/index.min.js", `${mangled.code?.replaceAll("new Array", "[]")}`);
})();