chore(*): Re-enable service worker

This commit is contained in:
Josh Creek
2024-07-12 14:21:04 +01:00
parent e7f1930eff
commit e512c63e0b
+25 -25
View File
@@ -1,32 +1,32 @@
// /// <reference lib="WebWorker" /> /// <reference lib="WebWorker" />
// /// <reference types="vite/client" /> /// <reference types="vite/client" />
// /// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
// /// <reference lib="esnext" /> /// <reference lib="esnext" />
// import { import {
// cleanupOutdatedCaches, cleanupOutdatedCaches,
// // createHandlerBoundToURL, // createHandlerBoundToURL,
// precacheAndRoute, precacheAndRoute,
// precache precache
// } from 'workbox-precaching'; } from 'workbox-precaching';
// // import { NavigationRoute, registerRoute } from 'workbox-routing'; // import { NavigationRoute, registerRoute } from 'workbox-routing';
// declare let self: ServiceWorkerGlobalScope; declare let self: ServiceWorkerGlobalScope;
// self.addEventListener('message', (event) => { self.addEventListener('message', (event) => {
// if (event.data && event.data.type === 'SKIP_WAITING') self.skipWaiting(); if (event.data && event.data.type === 'SKIP_WAITING') self.skipWaiting();
// }); });
// // Add root route to precache manifest // Add root route to precache manifest
// precache([{ url: '/', revision: null }]); precache([{ url: '/', revision: null }]);
// // self.__WB_MANIFEST is default injection point // self.__WB_MANIFEST is default injection point
// precacheAndRoute(self.__WB_MANIFEST); precacheAndRoute(self.__WB_MANIFEST);
// // clean old assets // clean old assets
// cleanupOutdatedCaches(); cleanupOutdatedCaches();
// // let allowlist: undefined | RegExp[]; // let allowlist: undefined | RegExp[];
// // if (import.meta.env.DEV) allowlist = [/^\/$/]; // if (import.meta.env.DEV) allowlist = [/^\/$/];
// // // to allow work offline // // to allow work offline
// // registerRoute(new NavigationRoute(createHandlerBoundToURL('/'), { allowlist })); // registerRoute(new NavigationRoute(createHandlerBoundToURL('/'), { allowlist }));