mirror of
https://github.com/Xevion/banner.git
synced 2026-01-31 02:23:34 -06:00
fix: run frontend build first with -e embed flag in Justfile
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user