2023-06-26 16:16:55 +01:00
|
|
|
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(), {
|
2023-06-26 16:16:55 +01:00
|
|
|
mangle: true,
|
|
|
|
toplevel: true,
|
|
|
|
});
|
2023-11-02 10:40:46 +00:00
|
|
|
writeFileSync("./build/index.min.js", `${mangled.code?.replaceAll("new Array", "[]")}`);
|
2023-06-26 16:16:55 +01:00
|
|
|
})();
|