Files
stock/serve/frontend/vite.config.ts
T
2026-07-04 17:32:39 +08:00

28 lines
552 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'node:path'
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
host: '0.0.0.0', // 允许局域网访问
port: 3011,
proxy: {
// dev 时 /api 转发到 FastAPI
'/api': {
target: 'http://localhost:3018',
},
'/health': 'http://localhost:3018',
},
},
build: {
outDir: 'dist',
sourcemap: false,
},
})