bufferStuff/tooling/mangle.ts
2024-12-16 10:23:30 +00:00

13 lines
No EOL
396 B
TypeScript

// Copyright (c) Holly Stubbs (tgpholly) - Licensed under MIT
// Check LICENSE in repository root for more information.
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}`);
})();