Skip to content
Permalink
Browse files
fix: relax pages regex for workbox 4 compatiblity
  • Loading branch information
pooya parsa committed Feb 8, 2019
1 parent 9167013 commit 04e74a7843ea54bcebca491c9abc0daa7ede3515
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
@@ -141,7 +141,7 @@ Default: `/_nuxt/(?!.*(__webpack_hmr|hot-update))`

Default is auto generated based on `router.base`.

Default: `^/(?!.*(__webpack_hmr|hot-update))`
Default: `/(?!.*(__webpack_hmr|hot-update))`

<!-- SW -->

@@ -53,7 +53,7 @@ function getOptions (moduleOptions) {

// Optionally cache other routes for offline
if (!options.pagesURLPattern) {
options.pagesURLPattern = joinUrl(`^${options.routerBase}`, HMRRegex)
options.pagesURLPattern = joinUrl(options.routerBase, HMRRegex)
}
if (options.offline && !options.offlinePage) {
options.runtimeCaching.push({
@@ -107,7 +107,7 @@ workbox.routing.registerRoute(new RegExp('https://google.com/.*'), new workbox.s
workbox.routing.registerRoute(new RegExp('/_nuxt/(?!.*(__webpack_hmr|hot-update))'), new workbox.strategies.CacheFirst ({}), 'GET')
// Register router handler for offlinePage
workbox.routing.registerRoute(new RegExp('^/(?!.*(__webpack_hmr|hot-update))'), ({event}) => {
workbox.routing.registerRoute(new RegExp('/(?!.*(__webpack_hmr|hot-update))'), ({event}) => {
return new workbox.strategies.NetworkOnly().handle({event})
.catch(() => caches.match('/offline.html'))
})
@@ -11,7 +11,7 @@ const regexes = {
cacheFirstCDN: new RegExp(`${CSNPublicPath}/${HMRRegex}`),

// Regex for networkFist
networkFirst: new RegExp(`^/${HMRRegex}`)
networkFirst: new RegExp(`/${HMRRegex}`)
}

const lists = {

0 comments on commit 04e74a7

Please sign in to comment.