34 lines
887 B
TypeScript
34 lines
887 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// Both dev server and preview proxy /api to the backend service.
|
|
// `api` is the compose service name, identical in dev and prod.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 3000,
|
|
// Polling: the repo is bind-mounted from a Windows host, whose file
|
|
// events often never reach the Linux watcher — without this, edits
|
|
// (local or via VS Code) silently keep serving stale modules.
|
|
watch: {
|
|
usePolling: true,
|
|
interval: 1000,
|
|
},
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://api:8000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
preview: {
|
|
port: 3000,
|
|
allowedHosts: ["kirche-einfach.jonas-miederer.com"],
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://api:8000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|