SPB Git

Repository Public

build.mjs 891 B 13 lines javascript

1// Bundles the API, the CLI and the managed-secrets process into dist/ (dependencies stay external, from node_modules).2import { build } from "esbuild";3import { cpSync, mkdirSync, rmSync } from "node:fs";4const common = { bundle: true, platform: "node", format: "esm", target: "node22", packages: "external", logLevel: "warning" };5rmSync("dist/migrations", { recursive: true, force: true }); mkdirSync("dist", { recursive: true });6await Promise.all([7  build({ ...common, entryPoints: ["services/api/src/index.ts"], outfile: "dist/server.mjs" }),8  build({ ...common, entryPoints: ["services/api/src/cli.ts"], outfile: "dist/cli.mjs" }),9  build({ ...common, entryPoints: ["services/managed-secrets/src/index.ts"], outfile: "dist/managed.mjs" }),10]);11cpSync("services/api/migrations", "dist/migrations", { recursive: true });12console.log("dist/server.mjs dist/cli.mjs dist/managed.mjs");13
Files main
Menu

Theme