final / vite.config.js
Yingtao-Zheng's picture
MERGE EVERYTHING from feature/integration-cleaned :((((((((((((((((((((((((((((((((((((((((((((((( so tired
2be007a
raw
history blame contribute delete
638 Bytes
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const backendUrl = env.VITE_BACKEND_URL || 'http://localhost:7860'
const backendWsUrl = backendUrl.replace(/^http/, 'ws')
return {
plugins: [react()],
server: {
proxy: {
'/api': {
target: backendUrl,
changeOrigin: true,
secure: false,
},
'/ws': {
target: backendWsUrl,
ws: true,
changeOrigin: true,
secure: false,
}
}
}
}
})