forked from gdg-x/hoverboard
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sw-precache-config.js
55 lines (55 loc) · 1.16 KB
/
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
47
48
49
50
51
52
53
54
55
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',
},
},
},
{
urlPattern: /https:\/\/maps\.googleapis\.com\/maps.*/,
handler: 'cacheFirst',
options: {
cache: {
name: 'google-maps-cache',
},
},
},
],
};