Skip to content

Commit 268e7ba

Browse files
author
Marlon Maxwel
committed
feat(react-scripts): migrate workbox v4: generateSW to injectManifest
1 parent 1cbc6f7 commit 268e7ba

File tree

3 files changed

+1805
-1885
lines changed

3 files changed

+1805
-1885
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
self.addEventListener('message', function(event) {
2+
if (event.data && event.data.type === 'SKIP_WAITING') {
3+
self.skipWaiting();
4+
}
5+
});
6+
7+
workbox.core.clientsClaim();
8+
9+
self.__precacheManifest = [].concat(self.__precacheManifest || []);
10+
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
11+
12+
workbox.routing.registerNavigationRoute(
13+
workbox.precaching.getCacheKeyForURL('/index.html'),
14+
{
15+
blacklist: [new RegExp('^/_'), new RegExp('/[^/?]+\\.[^/]+$')],
16+
}
17+
);

0 commit comments

Comments
 (0)