diff --git a/src/router/index.ts b/src/router/index.ts index e889100..27efec4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -15,7 +15,7 @@ const routes = [ ]; const router = createRouter({ - history: createWebHistory(), + history: createWebHistory(process.env.NODE_ENV === 'production' ? "/sharex-interface/" : "./"), routes }); diff --git a/vite.config.ts b/vite.config.ts index 89b0f3f..0a948f9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -17,7 +17,7 @@ export default defineConfig({ build: { target: "es2022", }, - base: "/sharex-interface/", + base: process.env.NODE_ENV === 'production' ? "/sharex-interface/" : "./", optimizeDeps: { esbuildOptions: { target: "es2022",