A service worker is a script that runs in the background without access to the UI, and a requisite for a Progressive Web App. They can be used, among others, for caching requests and assets.
Creating a Service Worker is not easy, and can be repetitive to do it for every single app. That’s where sw-precache jumps in, a module for automating the creation of service workers in a declarative way.
This lesson will go through creating a Service Worker using sw-precache.
the code for adding the package sw-precache
have a typo in the transcript.
sw-precache
is deprecated. Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
The most parts of this course are outdated.