27 lines
832 B
TypeScript
27 lines
832 B
TypeScript
import react from '@vitejs/plugin-react'
|
|
import { defineConfig } from 'vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
strictPort: true,
|
|
// Polling + explicit HMR client port make file-watch and the HMR
|
|
// websocket work reliably when Vite runs inside a (podman) container.
|
|
watch: { usePolling: true },
|
|
hmr: { clientPort: 5173 },
|
|
allowedHosts: true,
|
|
proxy: {
|
|
// Browser hits same-origin /api; Vite forwards to the backend service
|
|
// on the compose network (service name `php`, internal port 80) so the
|
|
// session cookie flows. NOT localhost:8100 — that is the host, not this
|
|
// container.
|
|
'/api': {
|
|
target: 'http://php:80',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|