d5279b124f
Storage Persistence Guard / storage-persistence-audit (push) Has been cancelled
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled
Client Quality Gates / Shared client and Web (pull_request) Has been cancelled
Client Quality Gates / macOS Desktop (pull_request) Has been cancelled
Storage Persistence Guard / storage-persistence-audit (pull_request) Has been cancelled
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const hmrClientPort = Number(process.env.VITE_HMR_CLIENT_PORT || "");
|
|
const defaultDevApiProxyTarget = hmrClientPort ? "http://backend:8000" : "http://127.0.0.1:8000";
|
|
const devApiProxyTarget = process.env.VITE_DEV_API_PROXY_TARGET || defaultDevApiProxyTarget;
|
|
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()],
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
host: tauriDevHost || true,
|
|
port: 5173,
|
|
strictPort: true,
|
|
hmr: hmrClientPort ? { clientPort: hmrClientPort } : undefined,
|
|
watch: {
|
|
ignored: ["**/src-tauri/**"],
|
|
},
|
|
proxy: {
|
|
"/api": {
|
|
target: devApiProxyTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
target: tauriPlatform === "windows" ? "chrome105" : "safari13",
|
|
minify: tauriDebug ? false : "esbuild",
|
|
sourcemap: tauriDebug,
|
|
},
|
|
});
|