-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkbox-config.cjs
More file actions
51 lines (51 loc) · 1.09 KB
/
workbox-config.cjs
File metadata and controls
51 lines (51 loc) · 1.09 KB
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
module.exports = {
maximumFileSizeToCacheInBytes: 100 * 1024 * 1024,
globDirectory: 'dist/',
globPatterns: ['**/*.{js,png,svg,json,txt,css,map}'],
globIgnores: ['*/fallback.js'],
globFollow: true,
swDest: 'dist/sw.js',
skipWaiting: false,
clientsClaim: false,
runtimeCaching: [
{
urlPattern: /\/static\/js\//,
handler: 'CacheFirst',
options: { cacheName: 'static-js' }
},
{
urlPattern: /\/static\/css\//,
handler: 'CacheFirst',
options: {
cacheName: 'static-css'
}
},
{
urlPattern: /\/static\/media\//,
handler: 'CacheFirst',
options: {
cacheName: 'static-media'
}
},
{
urlPattern: /^https:\/\/unpkg\.com/,
handler: 'CacheFirst',
options: {
cacheName: 'unpkg',
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: /^https:\/\/at\.alicdn\.com/,
handler: 'CacheFirst',
options: {
cacheName: 'at-alicdn',
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
};