not so initial commit

This commit is contained in:
2026-01-11 03:50:03 +01:00
commit a2016e2b0e
41 changed files with 54638 additions and 0 deletions

36
build.ts Normal file
View File

@@ -0,0 +1,36 @@
import { readdirSync, copyFileSync, mkdirSync, watch } from "fs";
import { join } from "path";
function copyAllFiles(srcDir: string, destDir: string) {
const entries = readdirSync(srcDir, { withFileTypes: true });
for (const entry of entries) {
const srcPath = join(srcDir, entry.name);
const destPath = join(destDir, entry.name);
if (entry.isDirectory()) {
mkdirSync(destPath, { recursive: true });
copyAllFiles(srcPath, destPath); // recursive
} else if (entry.isFile()) {
copyFileSync(srcPath, destPath);
}
}
}
function build() {
Bun.build({
entrypoints: ["src/index.tsx"],
minify: false,
sourcemap: true,
outdir: "dist/",
})
copyAllFiles("./public", "./dist");
}
const watcher = watch(import.meta.dir + "\\src", {recursive: true}, (event, filename) => {
console.log(`detected ${event} in ${filename}`);
build();
});
console.log("initial build");
build();