Files
arr/web/vite.config.ts
T
Miguel PalhasandClaude Opus 5.5 e953358f20 build(web): add React and Tailwind to the SPA
Tailwind's theme is reset to the design tokens and the existing
stylesheet moves under a components cascade layer, so utilities can
only produce token values and still win over component rules.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-11 00:36:23 +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,
},
},
},
};
});