-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkbox.config.js
More file actions
36 lines (35 loc) · 867 Bytes
/
workbox.config.js
File metadata and controls
36 lines (35 loc) · 867 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
34
35
36
const path = require('path')
module.exports = {
swSrc: path.join('static', 'service-worker.js'),
swDest: path.join('dist', 'service-worker.js'),
globDirectory: 'dist',
globPatterns: [
// json and html files should be precached together, otherwise hash
// validation error occurs.
'assets/**/*.{js,css,ttf,json}',
'**/*.html',
'assets/media/main_hero.*.mp4'
],
globIgnores: [
'**/404/**/*',
'**/*404*.{html,json,js}'
]
// used by wizard
/*
skipWaiting: true,
cleanupOutdatedCaches: true,
cacheId: 'assets',
clientsClaim: true,
runtimeCaching: [{
urlPattern: /\.(?:png|jpg|jpeg|svg|mp4)$/,
handler: 'StaleWhileRevalidate',
options: {
// networkTimeoutSeconds: 5, // Only for NetworkFirst strategy
cacheName: 'media',
expiration: {
maxEntries: '30'
}
}
}]
*/
}