Open History to see the last commit
1/**
2 * Copies the built web app into dist/client/ so the published npm package
3 * includes the web UI. This runs as a post-build step.
4 */
5import fs from "node:fs";
6import path from "node:path";
7import { fileURLToPath } from "node:url";
8
9const __dirname = path.dirname(fileURLToPath(import.meta.url));
10const webDist = path.resolve(__dirname, "../../web/dist");
11const target = path.resolve(__dirname, "../dist/client");
12
13if (!fs.existsSync(webDist)) {
14 console.log(
15 "⚠ Web dist not found — skipping client bundle. Run `bun run --cwd apps/web build` first.",
16 );
17 process.exit(0);
18}
19
20fs.cpSync(webDist, target, { recursive: true });
21console.log("✓ Bundled web app into dist/client");