-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkbox-config.js
More file actions
33 lines (29 loc) · 718 Bytes
/
workbox-config.js
File metadata and controls
33 lines (29 loc) · 718 Bytes
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
module.exports = {
"globDirectory": "./src/",
"globPatterns": [
"**/*.{html,json,jpg,png,mp4,gif,xml,ico,svg,webmanifest,js,css,webp}"
],
"swDest": "./src/serviceWorker/sw.js",
"globIgnores": [
'index.html',
'workbox-config.js',
'package.json',
'package-lock.json',
'node_modules/**/*',
],
// Define runtime caching rules.
"runtimeCaching": [{
// Match any request that ends with .png, .jpg, .jpeg, .webp, .ico or .svg
"urlPattern": /\.(?:png|jpg|jpeg|webp|ico|svg)$/,
// Apply a cache-first strategy.
"handler": 'CacheFirst',
"options": {
// Use a custom cache name.
"cacheName": 'images',
// Only cache 10 images.
"expiration": {
"maxEntries": 10,
},
},
}],
};