From b86b7732dc910fd70d04d4b7376925cca99422f4 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Sat, 25 Apr 2026 12:59:59 -0700 Subject: [PATCH] fix(pwa): set start_url/scope from VITE_BASE_URL so install launches /kiwi/ not site root --- frontend/vite.config.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 49612ac..0022ca6 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -3,6 +3,12 @@ import vue from '@vitejs/plugin-vue' import { VitePWA } from 'vite-plugin-pwa' import { fileURLToPath, URL } from 'node:url' +// Ensure start_url/scope match the deployment base path so the PWA launches +// at the correct URL (e.g. /kiwi/ in cloud, / in local dev) rather than the +// site root (which on menagerie.circuitforge.tech is the account page). +const rawBase = process.env.VITE_BASE_URL ?? '/' +const appBase = rawBase.endsWith('/') ? rawBase : rawBase + '/' + export default defineConfig({ plugins: [ vue(), @@ -21,8 +27,8 @@ export default defineConfig({ background_color: '#1e1c1a', display: 'standalone', orientation: 'portrait', - scope: '/', - start_url: '/', + scope: appBase, + start_url: appBase, icons: [ { src: '/icons/icon-192.png',