File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -57,24 +57,28 @@ function getOptions (moduleOptions) {
57
57
modifyUrlPrefix : {
58
58
'' : fixUrl ( publicPath )
59
59
} ,
60
+ offline : true ,
60
61
_runtimeCaching : [
61
62
// Cache all _nuxt resources at runtime
62
63
// They are hashed by webpack so are safe to loaded by cacheFirst handler
63
64
{
64
65
urlPattern : fixUrl ( publicPath + '/.*' ) ,
65
66
handler : 'cacheFirst'
66
- } ,
67
- // Cache other routes if offline
68
- {
69
- urlPattern : fixUrl ( routerBase + '/.*' ) ,
70
- handler : 'networkFirst'
71
67
}
72
68
] ,
73
69
runtimeCaching : [ ]
74
70
}
75
71
76
72
const options = defaultsDeep ( { } , this . options . workbox , moduleOptions , defaults )
77
73
74
+ // Optionally cache other routes for offline
75
+ if ( options . offline ) {
76
+ defaults . _runtimeCaching . push ( {
77
+ urlPattern : fixUrl ( routerBase + '/.*' ) ,
78
+ handler : 'networkFirst'
79
+ } )
80
+ }
81
+
78
82
return options
79
83
}
80
84
You can’t perform that action at this time.
0 commit comments