dispatch/client/js/sw.js
2020-05-17 06:34:59 +02:00

18 lines
463 B
JavaScript

import { skipWaiting, clientsClaim } from 'workbox-core';
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
import { NavigationRoute, registerRoute } from 'workbox-routing';
skipWaiting();
clientsClaim();
precacheAndRoute(self.__WB_MANIFEST, {
ignoreUrlParametersMatching: [/.*/]
});
const handler = createHandlerBoundToURL('/');
registerRoute(
new NavigationRoute(handler, {
denylist: [new RegExp('/downloads/')]
})
);