-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathworkbox-config.cjs
More file actions
54 lines (54 loc) · 1.02 KB
/
workbox-config.cjs
File metadata and controls
54 lines (54 loc) · 1.02 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
52
53
54
module.exports = {
"swDest": "./core/scripts/serviceWorker/sw.js",
"globDirectory": ".",
"globPatterns": [
"core/**/*.{html,json,png,ico,jpg,svg,webmanifest,css,js,pdf,fasta,md,pdf,webp,xlsx,png,jpeg}"
],
"globIgnores": [
"index.html",
"workbox-config.cjs",
"package.json",
"package-lock.json",
"node_modules/**/*",
"**/*.test.js"
],
"runtimeCaching": [
{
"urlPattern": /\.(?:png|jpg|jpeg|webp|ico|svg)$/,
"handler": "CacheFirst",
"options": {
"cacheName": "images",
"expiration": {
"maxEntries": 10
}
}
},
{
"urlPattern": /\.html$/,
"handler": "NetworkFirst",
"options": {
"cacheName": "html",
"networkTimeoutSeconds": 10,
"expiration": {
"maxEntries": 50
},
"cacheableResponse": {
"statuses": [0, 200]
}
}
},
{
"urlPattern": /\.(?:css|js)$/,
"handler": "NetworkFirst",
"options": {
"cacheName": "assets",
"expiration": {
"maxEntries": 50
},
"cacheableResponse": {
"statuses": [0, 200]
}
}
}
]
};