revite/src/sw.ts

12 lines
299 B
TypeScript
Raw Normal View History

2021-06-22 09:22:35 -04:00
/// <reference lib="webworker" />
import { precacheAndRoute } from 'workbox-precaching'
declare let self: ServiceWorkerGlobalScope
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING')
self.skipWaiting()
})
precacheAndRoute(self.__WB_MANIFEST)