20 lines
463 B
TypeScript
20 lines
463 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// 开发模式:把 /api 与 /ws 代理到 FastAPI 后端
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: { api: 'modern-compiler' },
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': { target: 'http://127.0.0.1:8000', changeOrigin: true },
|
|
'/ws': { target: 'ws://127.0.0.1:8000', ws: true },
|
|
},
|
|
},
|
|
})
|