mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-12 18:43:45 +00:00
chore(*): Re-enable service worker
This commit is contained in:
+25
-25
@@ -1,32 +1,32 @@
|
||||
// /// <reference lib="WebWorker" />
|
||||
// /// <reference types="vite/client" />
|
||||
// /// <reference no-default-lib="true"/>
|
||||
// /// <reference lib="esnext" />
|
||||
// import {
|
||||
// cleanupOutdatedCaches,
|
||||
// // createHandlerBoundToURL,
|
||||
// precacheAndRoute,
|
||||
// precache
|
||||
// } from 'workbox-precaching';
|
||||
// // import { NavigationRoute, registerRoute } from 'workbox-routing';
|
||||
/// <reference lib="WebWorker" />
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference no-default-lib="true"/>
|
||||
/// <reference lib="esnext" />
|
||||
import {
|
||||
cleanupOutdatedCaches,
|
||||
// createHandlerBoundToURL,
|
||||
precacheAndRoute,
|
||||
precache
|
||||
} from 'workbox-precaching';
|
||||
// import { NavigationRoute, registerRoute } from 'workbox-routing';
|
||||
|
||||
// declare let self: ServiceWorkerGlobalScope;
|
||||
declare let self: ServiceWorkerGlobalScope;
|
||||
|
||||
// self.addEventListener('message', (event) => {
|
||||
// if (event.data && event.data.type === 'SKIP_WAITING') self.skipWaiting();
|
||||
// });
|
||||
self.addEventListener('message', (event) => {
|
||||
if (event.data && event.data.type === 'SKIP_WAITING') self.skipWaiting();
|
||||
});
|
||||
|
||||
// // Add root route to precache manifest
|
||||
// precache([{ url: '/', revision: null }]);
|
||||
// Add root route to precache manifest
|
||||
precache([{ url: '/', revision: null }]);
|
||||
|
||||
// // self.__WB_MANIFEST is default injection point
|
||||
// precacheAndRoute(self.__WB_MANIFEST);
|
||||
// self.__WB_MANIFEST is default injection point
|
||||
precacheAndRoute(self.__WB_MANIFEST);
|
||||
|
||||
// // clean old assets
|
||||
// cleanupOutdatedCaches();
|
||||
// clean old assets
|
||||
cleanupOutdatedCaches();
|
||||
|
||||
// // let allowlist: undefined | RegExp[];
|
||||
// // if (import.meta.env.DEV) allowlist = [/^\/$/];
|
||||
// let allowlist: undefined | RegExp[];
|
||||
// if (import.meta.env.DEV) allowlist = [/^\/$/];
|
||||
|
||||
// // // to allow work offline
|
||||
// // registerRoute(new NavigationRoute(createHandlerBoundToURL('/'), { allowlist }));
|
||||
// // to allow work offline
|
||||
// registerRoute(new NavigationRoute(createHandlerBoundToURL('/'), { allowlist }));
|
||||
|
||||
Reference in New Issue
Block a user