From aa833e47bb288c93655c9504ea978cdba91e2084 Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Sai Potteri Date: Wed, 8 Jul 2026 13:49:29 +0530 Subject: [PATCH] fix: set vite base + PWA scope/start_url from VITE_BASE_URL for subpath serving --- vite.config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index ac626df..24a9aec 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,7 +4,10 @@ import tailwindcss from '@tailwindcss/vite' import { VitePWA } from 'vite-plugin-pwa' // https://vite.dev/config/ +const base = process.env.VITE_BASE_URL ?? '/' + export default defineConfig({ + base, plugins: [ react(), tailwindcss(), @@ -19,11 +22,11 @@ export default defineConfig({ background_color: '#0B1B3B', display: 'standalone', orientation: 'portrait', - start_url: '/orders', - scope: '/', + start_url: base + 'orders', + scope: base, }, workbox: { - navigateFallback: '/index.html', + navigateFallback: base + 'index.html', navigateFallbackDenylist: [/^\/usr\//, /^\/app\//], globPatterns: ['**/*.{js,css,html,svg,png,ico,woff2}'], },