项目目录从 refer 迁移到 local

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-04 16:32:48 +08:00
parent 648a8b7f1c
commit aad34202f1
302 changed files with 0 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
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',
// SSE 端点需要禁用缓冲
configure: (proxy) => {
proxy.on('proxyReq', (_proxyReq, req) => {
if (req.url?.includes('/stream')) {
_proxyReq.setHeader('Accept', 'text/event-stream');
_proxyReq.setHeader('Cache-Control', 'no-cache');
_proxyReq.setHeader('Connection', 'keep-alive');
}
});
},
},
'/health': 'http://localhost:3018',
},
},
build: {
outDir: 'dist',
sourcemap: false,
},
});