feat(desktop): implement phase 1 tauri client

This commit is contained in:
Cheng Zhou
2026-06-30 17:25:03 +08:00
parent 4654a812a0
commit d1a6c957f7
45 changed files with 5473 additions and 27 deletions
+19 -4
View File
@@ -2,7 +2,15 @@ import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath } from "node:url";
const devApiProxyTarget = process.env.VITE_DEV_API_PROXY_TARGET || "http://backend:8000";
const hmrClientPort = Number(process.env.VITE_HMR_CLIENT_PORT || "");
const tauriDevHost = process.env.TAURI_DEV_HOST;
const tauriPlatform = process.env.TAURI_ENV_PLATFORM;
const tauriDebug = process.env.TAURI_ENV_DEBUG === "true";
export default defineConfig({
clearScreen: false,
envPrefix: ["VITE_", "TAURI_ENV_"],
plugins: [
vue(),
{
@@ -27,16 +35,23 @@ export default defineConfig({
},
},
server: {
host: true,
host: tauriDevHost || true,
port: 5173,
hmr: {
clientPort: 8888,
strictPort: true,
hmr: hmrClientPort ? { clientPort: hmrClientPort } : undefined,
watch: {
ignored: ["**/src-tauri/**"],
},
proxy: {
"/api": {
target: "http://backend:8000",
target: devApiProxyTarget,
changeOrigin: true,
},
},
},
build: {
target: tauriPlatform === "windows" ? "chrome105" : "safari13",
minify: tauriDebug ? false : "esbuild",
sourcemap: tauriDebug,
},
});