fix(pwa): clientsClaim + skipWaiting fuer sofortiges Update bei neuen Deploys
Der bisherige autoUpdate-Mode hat den neuen SW erst beim naechsten Navigations-Event aktiviert -> alte Bundles (mit ASCII-Umlauten) blieben gecached. Mit clientsClaim+skipWaiting wird der neue SW sofort uebernommen und cleanupOutdatedCaches entfernt veraltete Caches.
This commit is contained in:
@@ -7,22 +7,28 @@ export default defineConfig({
|
|||||||
react(),
|
react(),
|
||||||
VitePWA({
|
VitePWA({
|
||||||
registerType: 'autoUpdate',
|
registerType: 'autoUpdate',
|
||||||
|
injectRegister: 'auto',
|
||||||
|
workbox: {
|
||||||
|
clientsClaim: true,
|
||||||
|
skipWaiting: true,
|
||||||
|
cleanupOutdatedCaches: true,
|
||||||
|
},
|
||||||
manifest: {
|
manifest: {
|
||||||
name: 'Dockly-Pfandsystem',
|
name: 'Dockly-Pfandsystem',
|
||||||
short_name: 'Dockly-Pfand',
|
short_name: 'Dockly-Pfand',
|
||||||
start_url: '.',
|
start_url: '.',
|
||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
background_color: '#f8fafc',
|
background_color: '#f8fafc',
|
||||||
theme_color: '#4338ca',
|
theme_color: '#051e23',
|
||||||
description: 'Digitale Pfand- und Tourenverwaltung',
|
description: 'Digitale Pfand- und Tourenverwaltung',
|
||||||
icons: [
|
icons: [
|
||||||
|
{ src: 'pfandlogo.png', sizes: '1000x1000', type: 'image/png' },
|
||||||
{ src: 'icon-192.png', sizes: '192x192', type: 'image/png' },
|
{ src: 'icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||||
{ src: 'icon-512.png', sizes: '512x512', type: 'image/png' }
|
{ src: 'icon-512.png', sizes: '512x512', type: 'image/png' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
includeAssets: ['icon-192.png', 'icon-512.png'],
|
includeAssets: ['icon-192.png', 'icon-512.png', 'pfandlogo.png'],
|
||||||
manifestFilename: 'manifest.webmanifest',
|
manifestFilename: 'manifest.webmanifest',
|
||||||
injectRegister: 'auto',
|
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
build: { outDir: 'dist' },
|
build: { outDir: 'dist' },
|
||||||
|
|||||||
Reference in New Issue
Block a user