Files
order_site/apps/frontend/vite.config.ts
T
2026-07-07 19:55:18 +08:00

32 lines
656 B
TypeScript

import path from 'node:path'
import { fileURLToPath } from 'node:url'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
const currentDir = path.dirname(fileURLToPath(import.meta.url))
const apiTarget = process.env.VITE_API_TARGET || 'http://127.0.0.1'
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(currentDir, 'src'),
},
},
server: {
host: '0.0.0.0',
port: 5173,
proxy: {
'/api': {
target: apiTarget,
changeOrigin: true,
},
'/health': {
target: apiTarget,
changeOrigin: true,
},
},
},
})