From b2a335122eaa48939cf5e50a14675fe7cf07a811 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 15 Jun 2026 08:45:29 +0000 Subject: [PATCH] build(web): node-server preset (apt-native runtime, no bun dependency) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch the Nitro build preset from `bun` to `node-server` so the built .output/server is a standalone HTTP server runnable by apt-native `node` (validated: `node .output/server/index.mjs` → Listening, /login 200 on node v25.9.0). This lets the upcoming punktfunk-web .deb depend on `nodejs (>= 20)` instead of vendoring the bun binary. CI still BUILDS with bun; only the runtime target changes, and bun still runs a node-server build, so existing `bun run .output/server/index.mjs` deployments keep working. `vite dev` is unaffected. Prereq for bundling the web console into the apt install. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/vite.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/vite.config.ts b/web/vite.config.ts index 3402f7f..41975d8 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -41,7 +41,11 @@ export default defineConfig({ // proxies to the management host injecting the bearer token server-side) — NOT a static // routeRule, so the proxy runs behind the login gate and reads env at runtime. nitroV2Plugin({ - preset: 'bun', + // node-server (not bun): a STANDALONE node HTTP server (`node .output/server/index.mjs` + // listens — the plain `node` preset only exports a handler). Lets the bundled punktfunk-web + // .deb depend on apt-native `nodejs (>= 20)` instead of vendoring bun. CI still BUILDS with + // bun; only the runtime target changes. (dev `vite dev` is unaffected.) + preset: 'node-server', compatibilityDate: '2026-06-10', // Scan server/{middleware,routes} for the auth gate + the /api proxy. scanDirs: [serverDir],