Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com> Co-committed-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #50.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// MealQuest service worker. vite-plugin-pwa replaces self.__WB_MANIFEST with
|
||||
// the build's precache list, and installing caches every entry. Serving from
|
||||
// that cache, expiring old entries and the update flow belong to the runtime
|
||||
// caching strategies, which are not built yet.
|
||||
|
||||
export {}
|
||||
|
||||
declare const self: ServiceWorkerGlobalScope & {
|
||||
__WB_MANIFEST: Array<{ url: string; revision: string | null }>
|
||||
}
|
||||
|
||||
const precacheName = 'mealquest-precache'
|
||||
const precacheURLs = self.__WB_MANIFEST.map((entry) => entry.url)
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(caches.open(precacheName).then((cache) => cache.addAll(precacheURLs)))
|
||||
})
|
||||
Reference in New Issue
Block a user