Files
DPM/vite.config.js
T
Pine b9eaef30f2 chore(dev): vite 监视优化与依赖清理
- vite.config:server.watch.ignored 忽略 src-tauri/backend venv/vendor(避免 ultralytics/matplotlib html 误触发整页 reload)
- 移除已弃用的 @mediapipe/tasks-vision(由后端 YOLO 替代)
2026-08-18 01:38:05 +08:00

28 lines
866 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 与后端 venvultralytics/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',
},
},
}));