Purpose
How frontend/kundkort/ is bundled and served.
Serving
The API server in src/api/index.ts:908-969 serves the SPA. Logic:
- Any non-
/api/, non-/healthGET/HEAD request enters the static-asset branch. - If path has an extension in
[tsx, ts, jsx, js, css, png, svg, ico, woff, woff2, html]and the file exists underfrontend/kundkort/, serve it. .tsx/.ts/.jsxfiles are transpiled on the fly vianew Bun.Transpiler({ target: 'browser' })(src/api/index.ts:928-941). Comment in source flags this as legacy; the prebuiltdist/app.jsis preferred.- Otherwise SPA fallback: serve
frontend/kundkort/index.html.
Dist artifacts
frontend/kundkort/index.html:77-78 references ./dist/app.css and ./dist/app.js. Three dist directories exist:
dist/— the live bundle.app.js~2.7 MB,app.css~6 KB.dist-debug/— sourcemapped build for debugging.app.js~1.0 MB plusapp.js.map~5.3 MB. Sourcemap referencesnode_modules/react,@tremor/react,recharts,d3-*,@headlessui/reactetc — confirms the bundle includes the full Tremor/Recharts dependency tree.dist.backup/— older bundle, css only is ~2.9 KB.
Warning
No npm script in root
package.jsonmatchesbun buildfor the frontend (the onlybuildistsc). The bundling command is not committed; ask the previous maintainer howdist/is regenerated.
Tailwind
Two configs coexist:
frontend/kundkort/index.html:14-76— inline config injected to the Tailwind CDN at runtime. Sets the Tremor color palette and a few utility extensions.frontend/kundkort/tailwind.config.js— file-based config with the same palette plus asafelistfor dynamically constructedbg-*-{50..950}etc. classes used by Insights Panel and Tremor Charts.
Note
The HTML inline config dropped its
safelistbecause “the safelist patterns for dynamic color classes were too complex for the browser to process” — seeindex.html:72-75. Required dynamic styles are baked intodist/app.cssinstead.
See also
Frontend Overview, Tremor Charts.