Created
November 15, 2018 07:56
-
-
Save cristoni/daf391f9a3354e7579c373d762ef5cd4 to your computer and use it in GitHub Desktop.
Esempio di service worker con workbox per workbox-webpack-plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (workbox) { | |
console.log(`Yay! Workbox is loaded 🎉`); | |
// workbox.setConfig({ debug: false }); | |
// workbox.precaching.suppressWarnings(); | |
workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); | |
workbox.routing.registerRoute(/^https?.*/, workbox.strategies.networkFirst(), 'GET'); | |
} else { | |
console.log(`Boo! Workbox didn't load 😬`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment