vite.config.js 542 B

123456789101112131415161718
  1. import { defineConfig } from 'vite'
  2. import react from '@vitejs/plugin-react'
  3. // 构建产物挂在 FastAPI 的 /app/ 下(base 必须对齐),旧看板仍占 /。
  4. // dev 时把数据/媒体请求代理到本地 uvicorn(8126),省去跨域。
  5. export default defineConfig({
  6. base: '/app/',
  7. plugins: [react()],
  8. build: { outDir: 'dist', emptyOutDir: true },
  9. server: {
  10. port: 5180,
  11. proxy: {
  12. '/api': 'http://127.0.0.1:8126',
  13. '/data': 'http://127.0.0.1:8126',
  14. '/frames': 'http://127.0.0.1:8126',
  15. },
  16. },
  17. })