farmcontrol-server/scripts/build-server.mjs
Tom Butcher 8453e7c7cf Switch package manager and runtime from Node/pnpm to Bun.
Update build scripts, entry points, and packaged-path detection for the new toolchain.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 22:03:20 +01:00

16 lines
630 B
JavaScript

import { cpSync, mkdirSync, rmSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const buildDir = path.join(rootDir, "build");
rmSync(buildDir, { recursive: true, force: true });
mkdirSync(buildDir, { recursive: true });
cpSync(path.join(rootDir, "src"), buildDir, { recursive: true });
cpSync(path.join(rootDir, "package.json"), path.join(buildDir, "package.json"));
cpSync(path.join(rootDir, "config.json"), path.join(buildDir, "config.json"));
console.log(`Server sources copied to ${buildDir}`);