sass-imobiliaria/frontend/vite.config.ts

23 lines
644 B
TypeScript

import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
// In Docker, the backend service is reachable by its service name.
// VITE_API_HOST is set in docker-compose.yml; falls back to localhost for local dev.
const apiHost = process.env.VITE_API_HOST ?? 'localhost'
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
watch: {
usePolling: true,
ignored: ['**/public/imoveis/**'],
},
proxy: {
'/api': {
target: `http://${apiHost}:5000`,
changeOrigin: true,
},
},
},
})