Files
arr/web/vite.config.ts
T
Miguel PalhasandClaude Fable 5 f025b2529d
ci / web (pull_request) Failing after 34s
ci / rust (pull_request) Successful in 1m46s
e2e / e2e (pull_request) Successful in 1m20s
feat(web): SPA skeleton embedded in the binary
Vite + TypeScript, no framework. One health board page proves the
whole path: fetch /api/health, render per-upstream verdicts. Biome
and tsc join the just ci gate; dev mode proxies /api to the daemon.

arr-daemon embeds web/dist via include_dir: build.rs runs pnpm when
available, accepts ARR_WEB_DIST prebuilt, and falls back to a
placeholder only in debug so the node-less CI rust job keeps working.

Closes #6

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-22 20:34:12 +01:00

30 lines
759 B
TypeScript

import { defineConfig, loadEnv } from "vite";
// Dev-mode proxy target: the running daemon. `pnpm dev` gives hot reload while
// every `/api/*` request goes to a real arr. Override with:
// ARR_DAEMON_URL=http://other-host:7878 pnpm dev
const DEFAULT_DAEMON_URL = "http://127.0.0.1:7878";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const target = (env.ARR_DAEMON_URL ?? DEFAULT_DAEMON_URL).replace(/\/+$/, "");
return {
build: {
target: "es2022",
outDir: "dist",
emptyOutDir: true,
sourcemap: false,
},
server: {
host: true,
port: 5173,
proxy: {
"/api": {
target,
changeOrigin: true,
},
},
},
};
});