feat(desktop): implement phase 1 tauri client
This commit is contained in:
+19
-4
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user