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'
|
import { VitePWA } from 'vite-plugin-pwa'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
|
const base = process.env.VITE_BASE_URL ?? '/'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
base,
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
@ -19,11 +22,11 @@ export default defineConfig({
|
|||||||
background_color: '#0B1B3B',
|
background_color: '#0B1B3B',
|
||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
orientation: 'portrait',
|
orientation: 'portrait',
|
||||||
start_url: '/orders',
|
start_url: base + 'orders',
|
||||||
scope: '/',
|
scope: base,
|
||||||
},
|
},
|
||||||
workbox: {
|
workbox: {
|
||||||
navigateFallback: '/index.html',
|
navigateFallback: base + 'index.html',
|
||||||
navigateFallbackDenylist: [/^\/usr\//, /^\/app\//],
|
navigateFallbackDenylist: [/^\/usr\//, /^\/app\//],
|
||||||
globPatterns: ['**/*.{js,css,html,svg,png,ico,woff2}'],
|
globPatterns: ['**/*.{js,css,html,svg,png,ico,woff2}'],
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user