1
+ const packageJson = require ( './package.json' ) ;
2
+
1
3
module . exports = {
2
- cacheId : ' compas' ,
4
+ cacheId : ` compas- ${ packageJson . version } ` ,
3
5
globDirectory : 'build/' ,
4
6
globPatterns : [
5
7
'_snowpack/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}' ,
6
8
'public/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}' ,
7
9
'src/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}' ,
8
10
'*.{md,json,ico,xml}' ,
11
+ 'package.json.proxy.js' ,
9
12
] ,
10
- globIgnores : [
11
- 'public/nsdoc/README.md'
12
- ] ,
13
+ globIgnores : [ 'public/nsdoc/README.md' ] ,
13
14
swDest : 'build/sw.js' ,
14
15
runtimeCaching : [
16
+ {
17
+ urlPattern : / p a c k a g e \. j s o n \. p r o x y \. j s $ / ,
18
+ handler : 'NetworkOnly' ,
19
+ } ,
15
20
{
16
21
urlPattern : / \/ ( _ s n o w p a c k | p u b l i c | s r c ) \/ .* / ,
17
22
handler : 'NetworkFirst' ,
@@ -20,10 +25,11 @@ module.exports = {
20
25
fetchOptions : {
21
26
credentials : 'include' ,
22
27
} ,
23
- }
28
+ } ,
24
29
} ,
25
30
] ,
26
31
skipWaiting : true ,
32
+ clientsClaim : true ,
27
33
inlineWorkboxRuntime : true ,
28
34
cleanupOutdatedCaches : true ,
29
35
} ;
0 commit comments