4e8ae4024a
- 移除 /api /file /media /upload → :10801 代理(前端已走 API_BASE 直连 Python 后端 :10085) - defineConfig 由 async 简化为同步
22 lines
730 B
JavaScript
22 lines
730 B
JavaScript
import { defineConfig } from "vite";
|
||
import react from "@vitejs/plugin-react";
|
||
import tailwindcss from "@tailwindcss/vite";
|
||
|
||
// https://vite.dev/config/
|
||
export default defineConfig({
|
||
plugins: [react(), tailwindcss()],
|
||
|
||
clearScreen: false,
|
||
server: {
|
||
port: 1420,
|
||
strictPort: true,
|
||
// 监听所有网络接口,局域网内其他设备可通过 http://<IP>:1420 访问
|
||
host: true,
|
||
watch: {
|
||
// 忽略 src-tauri 与后端 venv/vendor(ultralytics/matplotlib 的 html 会误触发页面 reload)
|
||
ignored: ["**/src-tauri/**", "**/backend/.venv/**", "**/backend/vendor/**"],
|
||
},
|
||
// 注:API 走 src/config.js 的 API_BASE(Python 后端 :10085)直连,不再需要 dev 代理
|
||
},
|
||
});
|