Files
zopu-code/scripts/vercel-build.ts
-Puter 08bc5ae259 feat(web): vercel deployment and vds compose/systemd setup
Add Vercel config with React Router preset, vercel-build script and
/api/auth rewrite to the Convex site. Add VDS staging compose for the
Rivet engine and runner plus systemd units, deployment plan, and
Docker/Vercel ignore rules. Lockfile covers both the web and agents
dependency additions.
2026-08-01 20:18:09 +05:30

22 lines
652 B
TypeScript

import { execFileSync } from "node:child_process";
import { mkdir, readFile, writeFile } from "node:fs/promises";
const appDirectory = "apps/web";
const resultPath = `${appDirectory}/.vercel/react-router-build-result.json`;
execFileSync("pnpm", ["run", "--filter", "web", "build"], {
stdio: "inherit",
});
const result = JSON.parse(await readFile(resultPath, "utf8"));
for (const bundle of Object.values(result.buildManifest.serverBundles)) {
bundle.file = `${appDirectory}/${bundle.file}`;
}
await mkdir(".vercel", { recursive: true });
await writeFile(
".vercel/react-router-build-result.json",
`${JSON.stringify(result, null, 2)}\n`
);