- tauri 设计完成

This commit is contained in:
Pine
2026-05-12 23:19:37 +08:00
parent c8e8dd12d2
commit 4ad266f6c4
25 changed files with 3495 additions and 3039 deletions
+8 -10
View File
@@ -7,25 +7,23 @@ const host = process.env.TAURI_DEV_HOST;
export default defineConfig(async () => ({
plugins: [react()],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent Vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || "127.0.0.1",
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
? { protocol: "ws", host, port: 1421 }
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
// 开发时代理 API 请求到 Python/Rust 后端
proxy: {
'/api': 'http://localhost:8000',
'/file': 'http://localhost:8000',
'/media': 'http://localhost:8000',
'/upload': 'http://localhost:8000',
},
},
}));