feat(server): serve the client-only build with Bun

Angular's server build needs Node loader hooks that Bun does not apply,
and every route is client-rendered, so Angular now builds a client-only
bundle and a small Bun.serve server delivers it: hashed assets with the
one-year cache, index.html revalidated, extension-less routes falling
back to index.html, missing assets 404, traversal and malformed paths
rejected, and other methods 405. Express, @angular/ssr and the unused
hydration provider are removed. Both Docker stages use the pinned
oven/bun:1.4.3-alpine image without Node, and the health checks use
Bun's fetch.

Refs #292

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-10-17 13:50:05 +02:00
1 parent 94d57add2c
commit f74d744f9b
15 files changed
+260 -306

No files matched your search

+2 -5
View File
@@ -5,9 +5,10 @@
"ng": "ng",
"start": "bun scripts/generate-langs.js && ng serve",
"build": "bun scripts/generate-langs.js && ng build",
"postbuild": "bun build src/server.ts --target=bun --outfile dist/vac-optimizer/server/server.js",
"watch": "bun scripts/generate-langs.js && ng build --watch --configuration development",
"test": "bun scripts/generate-langs.js && bun test --isolate",
"serve:ssr:vac-optimizer": "bun dist/vac-optimizer/server/server.mjs",
"serve": "bun dist/vac-optimizer/server/server.js",
"lint": "bun scripts/generate-langs.js && eslint \"src/**/*.ts\"",
"lint:fix": "bun scripts/generate-langs.js && eslint \"src/**/*.ts\" --fix",
"format": "bun scripts/generate-langs.js && prettier --write \"src/**/*.{ts,html,scss,css,json}\"",
@@ -36,12 +37,9 @@
"@angular/material": "^22.0.0",
"@angular/platform-browser": "22.2.1",
"@angular/platform-browser-dynamic": "22.2.1",
"@angular/platform-server": "22.2.1",
"@angular/router": "22.2.1",
"@angular/ssr": "22.2.2",
"date-holidays": "^3.30.2",
"dayjs": "^1.11.21",
"express": "^5.2.1",
"rxjs": "~7.8.2",
"tslib": "^2.8.1"
},
@@ -52,7 +50,6 @@
"@angular/compiler-cli": "22.2.1",
"@eslint/js": "^10.0.1",
"@types/bun": "1.4.3",
"@types/express": "^5.0.6",
"@types/jsdom": "^21.1.7",
"@types/node": "^26.0.0",
"eslint": "^10.4.1",