2026-10-09 12:16:48 +05:30

22 lines
502 B
TypeScript

import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const apiTarget = env.VITE_API_URL || 'http://localhost:8000'
return {
plugins: [react()],
server: {
host: true,
allowedHosts: true, // Add this line
proxy: {
'/api': {
target: apiTarget,
changeOrigin: true,
secure: false,
}
}
}
}
})