fix: run frontend build first with -e embed flag in Justfile

This commit is contained in:
2026-01-29 15:00:13 -06:00
parent 36bcc27d7f
commit 2947face06
+15 -3
View File
@@ -168,9 +168,21 @@ dev *flags:
const profileDir = release ? "release" : "debug"; const profileDir = release ? "release" : "debug";
const procs = []; const procs = [];
const cleanup = () => { for (const p of procs) p.kill(); }; const cleanup = async () => {
process.on("SIGINT", () => { cleanup(); process.exit(130); }); for (const p of procs) p.kill();
process.on("SIGTERM", () => { cleanup(); process.exit(143); }); await Promise.all(procs.map(p => p.exited));
};
process.on("SIGINT", async () => { await cleanup(); process.exit(0); });
process.on("SIGTERM", async () => { await cleanup(); process.exit(0); });
// Build frontend first when embedding assets (backend will bake them in)
if (embed && !noBuild) {
console.log(`\x1b[1;36m→ Building frontend (for embedding)...\x1b[0m`);
const fb = Bun.spawnSync(["bun", "run", "--cwd", "web", "build"], {
stdio: ["inherit", "inherit", "inherit"],
});
if (fb.exitCode !== 0) process.exit(fb.exitCode);
}
// Frontend: Vite dev server // Frontend: Vite dev server
if (runFrontend) { if (runFrontend) {