import { precacheAndRoute } from 'workbox-precaching'

precacheAndRoute(self.__WB_MANIFEST)

self.addEventListener('install', () => {
  self.skipWaiting()

  // Perform any other actions required for your
  // service worker to install, potentially inside
  // of event.waitUntil();
})

// I choose https://developer.chrome.com/docs/workbox/the-ways-of-workbox/#workbox-cli
// but we can integrate Workbox another way
// using Webpack build process, thanks to generateSW or injectManifest
// this can be done after this story's validation

@@ -86,21 +86,16 @@
 IFEST)%0A%0A
-self.
 addEvent
@@ -108,174 +108,113 @@
 er('
-install', () =%3E %7B%0A  self.skipWaiting()%0A%0A  // Perform any other actions required for your%0A  // service worker to install, potentially inside%0A  // of event.waitUntil();
+message', event =%3E %7B%0A  if (event.data && event.data.type === 'SKIP_WAITING') %7B%0A    self.skipWaiting()%0A  %7D
 %0A%7D)%0A

Revert "fix(service-worker): install new service worker without waiting"