Files
arr/web/vite.config.ts
T
naps62-yolo 514628f089
ci / web (push) Successful in 33s
ci / rust (push) Successful in 57s
e2e / e2e (push) Successful in 1m7s
feat(web): SPA skeleton embedded in the binary (#60)
2026-08-22 21:07:40 +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,
},
},
},
};
});