forked from gdg-x/hoverboard
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sw-precache-config.js
46 lines (46 loc) · 997 Bytes
/
sw-precache-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module.exports = {
staticFileGlobs: [
'/index.html',
'/manifest.json',
'/bower_components/webcomponentsjs/*.js',
'/bower_components/firebase/firebase.js',
'/bower_components/firebase/firebase-firestore.js',
'/images/**/*',
'/scripts/**/*',
'/data/**/*',
'/src/**/*',
],
navigateFallback: '/index.html',
directoryIndex: 'index.html',
navigateFallbackWhitelist: [/^\/[^\_]+\//],
runtimeCaching: [
{
urlPattern: /\/images\/.*/,
handler: 'networkFirst',
options: {
cache: {
maxEntries: 200,
name: 'items-cache',
},
},
},
{
urlPattern: /\/bower_components\/.*/,
handler: 'cacheFirst',
options: {
cache: {
name: 'bower-components-cache',
},
},
},
{
urlPattern: /\/node_modules\/.*/,
handler: 'cacheFirst',
options: {
cache: {
name: 'node-modules-cache',
},
},
},
],
};