bufferStuff/tooling/mangle.ts

13 lines
396 B
TypeScript
Raw Normal View History

2024-12-16 10:23:30 +00:00
// Copyright (c) Holly Stubbs (tgpholly) - Licensed under MIT
// Check LICENSE in repository root for more information.
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}`);
})();