22 lines
558 B
TypeScript
22 lines
558 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
const backendPort = process.env.DEV_BACKEND_PORT || '18088'
|
|
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET || `http://127.0.0.1:${backendPort}`
|
|
const distributionPort = Number(process.env.DEV_DISTRIBUTION_PORT || process.env.PORT || 5190)
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: distributionPort,
|
|
allowedHosts: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: apiProxyTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|