Project Files
build.mjs
#!/usr/bin/env node
import { execSync } from "node:child_process";
import { rmSync, cpSync, existsSync } from "node:fs";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = fileURLToPath(new URL(".", import.meta.url));
try {
console.log("Cleaning dist folder...");
rmSync(resolve(__dirname, "dist"), { recursive: true, force: true });
console.log("Compiling TypeScript...");
execSync("npx tsc", { stdio: "inherit", cwd: resolve(__dirname) });
console.log("Build complete.");
} catch (e) {
console.error("Build error:", e.message);
process.exit(1);
}