fix: set vite base + PWA scope/start_url from VITE_BASE_URL for subpath serving
This commit is contained in:
parent
e3ce9e21af
commit
aa833e47bb
@ -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}'],
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user