Files
alrahma_web_client/vite.config.ts
T
2026-06-07 20:01:56 -04:00

26 lines
622 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
/** Laravel API for dev proxy (`/api` → this host). Override: `VITE_PROXY_API=http://localhost:8000 npm run dev`. */
const apiTarget = process.env.VITE_PROXY_API ?? process.env.VITE_API_ORIGIN ?? 'http://localhost:8000'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: true,
port: 5173,
strictPort: true,
watch: {
usePolling: true,
},
proxy: {
'/api': {
target: apiTarget,
changeOrigin: true,
secure: false,
},
},
},
})