🎉 init: 小龙的工作空间
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/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);
|
||||
}
|
||||
Reference in New Issue
Block a user