2026-06-11 02:19:47 +02:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
|
|
|
|
|
// During `vite dev` (host with Node), proxy API calls to the backend container.
|
2026-06-11 22:00:57 +02:00
|
|
|
// Use 127.0.0.1 (not "localhost") so Node doesn't resolve to IPv6 ::1, which the
|
|
|
|
|
// Docker port publish may not answer — that surfaces as proxy connection failures.
|
|
|
|
|
const target = "http://127.0.0.1:8080";
|
2026-06-11 02:19:47 +02:00
|
|
|
const proxy = {
|
2026-06-11 22:00:57 +02:00
|
|
|
"/api": target,
|
|
|
|
|
"/auth": target,
|
|
|
|
|
"/healthz": target,
|
2026-06-11 02:19:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
server: { port: 5173, proxy },
|
|
|
|
|
build: { outDir: "dist" },
|
|
|
|
|
});
|