b9eaef30f2
- vite.config:server.watch.ignored 忽略 src-tauri/backend venv/vendor(避免 ultralytics/matplotlib html 误触发整页 reload) - 移除已弃用的 @mediapipe/tasks-vision(由后端 YOLO 替代)
28 lines
866 B
JavaScript
28 lines
866 B
JavaScript
import { defineConfig } from "vite";
|
||
import react from "@vitejs/plugin-react";
|
||
import tailwindcss from "@tailwindcss/vite";
|
||
|
||
// https://vite.dev/config/
|
||
export default defineConfig(async () => ({
|
||
plugins: [react(), tailwindcss()],
|
||
|
||
clearScreen: false,
|
||
server: {
|
||
port: 1420,
|
||
strictPort: true,
|
||
// 监听所有网络接口,局域网内其他设备可通过 http://<IP>:1420 访问
|
||
host: true,
|
||
watch: {
|
||
// 忽略 src-tauri 与后端 venv(ultralytics/matplotlib 的 html 会误触发页面 reload)
|
||
ignored: ["**/src-tauri/**", "**/backend/.venv/**", "**/backend/vendor/**"],
|
||
},
|
||
// 开发时代理 API 请求到 Rust 后端
|
||
proxy: {
|
||
'/api': 'http://localhost:10801',
|
||
'/file': 'http://localhost:10801',
|
||
'/media': 'http://localhost:10801',
|
||
'/upload': 'http://localhost:10801',
|
||
},
|
||
},
|
||
}));
|