27 lines
988 B
TypeScript
27 lines
988 B
TypeScript
import tailwindcss from "@tailwindcss/vite";
|
|||
|
|
import { sveltekit } from "@sveltejs/kit/vite";
|
||
|
|
import path from "node:path";
|
||
|
|
import { fileURLToPath } from "node:url";
|
||
|
|
import { defineConfig } from "vite";
|
||
|
|
import { DEV_API_PROXY_TARGET, DEV_WEB_PORT } from "../../scripts/dev-ports.mjs";
|
||
|
|
|
||
|
|
const monorepoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
// Load PUBLIC_* from monorepo-root .env (same file as the Go API).
|
||
|
|
envDir: monorepoRoot,
|
||
|
|
plugins: [tailwindcss(), sveltekit()],
|
||
|
|
server: {
|
||
|
|
// true → all interfaces (IPv4 + IPv6). Default localhost is ::1-only on Windows,
|
||
|
|
// which breaks 127.0.0.1 probes and some browser Happy Eyeballs paths.
|
||
|
|
host: true,
|
||
|
|
port: DEV_WEB_PORT,
|
||
|
|
strictPort: true,
|
||
|
|
proxy: {
|
||
|
|
"/api": { target: DEV_API_PROXY_TARGET, changeOrigin: true },
|
||
|
|
"/healthz": { target: DEV_API_PROXY_TARGET, changeOrigin: true },
|
||
|
|
"/readyz": { target: DEV_API_PROXY_TARGET, changeOrigin: true }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|