From 7e55115a3ab0e12b9c8c6682178d45d6722bea8d Mon Sep 17 00:00:00 2001 From: Adrien Poupa Date: Wed, 13 Aug 2025 00:08:39 -0400 Subject: [PATCH] fix(vite): Configure Vite to use subfolder --- vue3/src/apps/tandoor/main.ts | 6 +++++- vue3/vite.config.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vue3/src/apps/tandoor/main.ts b/vue3/src/apps/tandoor/main.ts index a66b9d114..8ee64b1a8 100644 --- a/vue3/src/apps/tandoor/main.ts +++ b/vue3/src/apps/tandoor/main.ts @@ -63,8 +63,12 @@ TANDOOR_PLUGINS.forEach(plugin => { routes = routes.concat(plugin.routes) }) +const basePath = localStorage.getItem("BASE_PATH") +const pathname = basePath?.startsWith("http") ? new URL(basePath).pathname : undefined +const base = pathname === "/" ? undefined : pathname + const router = createRouter({ - history: createWebHistory(), + history: createWebHistory(base), routes, }) diff --git a/vue3/vite.config.ts b/vue3/vite.config.ts index fdf3113ca..195d5d194 100644 --- a/vue3/vite.config.ts +++ b/vue3/vite.config.ts @@ -7,7 +7,7 @@ import {VitePWA} from "vite-plugin-pwa"; // https://vitejs.dev/config/ export default defineConfig({ - base: '/static/vue3/', + base: './', plugins: [ vue({ template: {transformAssetUrls}