File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,6 @@ function getOptions (moduleOptions) {
112
112
delete options . offlinePageAssets
113
113
}
114
114
115
- // Optionally cache other routes for offline
116
- if ( options . offline && ! options . offlinePage ) {
117
- options . _runtimeCaching . push ( {
118
- urlPattern : fixUrl ( `${ routerBase } /.*` ) ,
119
- handler : 'networkFirst'
120
- } )
121
- }
122
-
123
115
if ( options . cachingExtensions ) {
124
116
options . cachingExtensions = loadScriptExtension . call ( this , options . cachingExtensions )
125
117
}
@@ -136,6 +128,15 @@ function getOptions (moduleOptions) {
136
128
// =============================================
137
129
138
130
function addTemplates ( options ) {
131
+ // Optionally cache other routes for offline
132
+ const routerBase = this . options . router . base
133
+ if ( options . offline && ! options . offlinePage ) {
134
+ options . runtimeCaching . push ( {
135
+ urlPattern : fixUrl ( `${ routerBase } /.*` ) ,
136
+ handler : 'networkFirst'
137
+ } )
138
+ }
139
+
139
140
// Add sw.template.js
140
141
this . addTemplate ( {
141
142
src : path . resolve ( __dirname , 'templates/sw.template.js' ) ,
You can’t perform that action at this time.
0 commit comments