From 024847a45aad3b81254f3dd1cd4f6126cfd70781 Mon Sep 17 00:00:00 2001 From: Charles <78650751+Charles-IX@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:28:39 +0800 Subject: [PATCH] feat: allow deployment on subpaths --- index.html | 4 ++++ src/components/AppRoot.tsx | 2 +- src/vite-env.d.ts | 4 ++++ vite.config.ts | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2637967..b6751ea 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,10 @@ + diff --git a/src/components/AppRoot.tsx b/src/components/AppRoot.tsx index dbee96a..328dc06 100644 --- a/src/components/AppRoot.tsx +++ b/src/components/AppRoot.tsx @@ -25,7 +25,7 @@ export function AppRoot() { useEffect(() => persistSettings(store), []); return ( - +
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 02deb07..91ce5dc 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -17,3 +17,7 @@ declare module '*&mac-command' { export const commandName: string; export const tarName: string; } + +declare interface Window { + BASE_URL: string; +} diff --git a/vite.config.ts b/vite.config.ts index 97af5d2..fafa0e1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -23,6 +23,7 @@ const version = `${pkg.version} (${shortCommit})`; // https://vitejs.dev/config/ export default defineConfig({ + base: './', worker: { format: 'es', },