#!/usr/bin/env node /** * Build script — builds both web and api. * Usage: node scripts/build.mjs */ import { execSync } from "node:child_process"; const ROOT = new URL("..", import.meta.url).pathname; function run(cmd, cwd) { console.log(`\nšŸ”Ø ${cmd} (in ${cwd})`); execSync(cmd, { cwd, stdio: "inherit" }); } console.log("šŸ—ļø Building fullstack project...\n"); try { run("npm run build", `${ROOT}/apps/api`); run("npm run build", `${ROOT}/apps/web`); console.log("\nāœ… Build complete!"); } catch (e) { console.error("\nāŒ Build failed:", e.message); process.exit(1); }