Files
arr/web/vite.config.ts
T
naps62-yolo 5528ac8aa8
ci / web (push) Successful in 29s
e2e / e2e (push) Successful in 1m31s
ci / rust (push) Successful in 1m41s
ci / image (push) Successful in 3m42s
refactor(web): rebuild the UI in React and Tailwind (#279)
2026-11-11 16:34:47 +00:00

33 lines
885 B
TypeScript

import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
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 {
plugins: [react(), tailwindcss()],
build: {
target: "es2022",
outDir: "dist",
emptyOutDir: true,
sourcemap: false,
},
server: {
host: true,
port: 5173,
proxy: {
"/api": {
target,
changeOrigin: true,
},
},
},
};
});