Files
DPM/vite.config.js
T

22 lines
730 B
JavaScript
Raw Normal View History

2026-05-12 22:38:52 +08:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
2026-08-17 18:37:16 +08:00
import tailwindcss from "@tailwindcss/vite";
2026-05-14 15:07:41 +08:00
2026-05-12 22:38:52 +08:00
// https://vite.dev/config/
export default defineConfig({
2026-08-17 18:37:16 +08:00
plugins: [react(), tailwindcss()],
2026-05-12 22:38:52 +08:00
clearScreen: false,
server: {
port: 1420,
strictPort: true,
2026-05-13 00:18:13 +08:00
// 监听所有网络接口,局域网内其他设备可通过 http://<IP>:1420 访问
host: true,
2026-05-12 22:38:52 +08:00
watch: {
// 忽略 src-tauri 与后端 venv/vendorultralytics/matplotlib 的 html 会误触发页面 reload
ignored: ["**/src-tauri/**", "**/backend/.venv/**", "**/backend/vendor/**"],
2026-05-12 22:38:52 +08:00
},
// 注:API 走 src/config.js 的 API_BASEPython 后端 :10085)直连,不再需要 dev 代理
2026-05-12 22:38:52 +08:00
},
});