This commit is contained in:
2025-10-03 15:43:22 +05:00
commit 531e2d2e7e
54 changed files with 2943 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import { $, Glob } from "bun";
import path from "path";
import { existsSync } from "fs";
// Cross-platform directory removal
if (process.platform === "win32") {
// await $`cmd /c "rmdir /s /q dist"`;
} else {
await $`rm -rf ./dist`;
}
// await Bun.build({
// entrypoints: ["./src/index.ts"],
// env: "inline",
// target: "bun",
// outdir: `./dist`,
// minify: true,
// });
// Build all files in src
for (const entrypoint of new Glob("./src/**/*.ts").scanSync()) {
const parts = entrypoint.split(path.sep);
const entrypointPath = path.join(...parts.slice(2, -1));
await Bun.build({
entrypoints: [entrypoint],
target: "bun",
outdir: path.join("dist", entrypointPath),
env: "inline",
minify: true,
});
}