20 lines
536 B
TypeScript
20 lines
536 B
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// 构建产物直接写进仓库根的 static/,FastAPI 原样托管;开发时用 vite 代理 /api。
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
build: {
|
|
outDir: fileURLToPath(new URL('../static', import.meta.url)),
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': 'http://127.0.0.1:8848',
|
|
},
|
|
},
|
|
})
|