@nuxtjs/workbox
Advanced tools
Comparing version 3.0.0-beta.14 to 3.0.0-beta.15
@@ -6,2 +6,29 @@ # Change Log | ||
# [3.0.0-beta.15](https://github.com/nuxt-community/pwa-module/compare/v3.0.0-beta.14...v3.0.0-beta.15) (2019-05-07) | ||
### Bug Fixes | ||
* **workbox:** disable `cacheAssets` for dev mode ([dbf6d67](https://github.com/nuxt-community/pwa-module/commit/dbf6d67)) | ||
* **workbox:** use NetworkFirst for dev ([9a67580](https://github.com/nuxt-community/pwa-module/commit/9a67580)) | ||
### Features | ||
* **workbox:** offlineStrategy ([e377436](https://github.com/nuxt-community/pwa-module/commit/e377436)) | ||
### Reverts | ||
* remove unnecessary hmr regex ([1ac5f5c](https://github.com/nuxt-community/pwa-module/commit/1ac5f5c)) | ||
### BREAKING CHANGES | ||
* **workbox:** default changed from NetworkOnly to NetworkFirst when offlinePage is enabled | ||
# [3.0.0-beta.14](https://github.com/nuxt-community/pwa-module/compare/v3.0.0-beta.13...v3.0.0-beta.14) (2019-03-17) | ||
@@ -8,0 +35,0 @@ |
@@ -28,2 +28,3 @@ module.exports = { | ||
offline: true, | ||
offlineStrategy: 'NetworkFirst', | ||
offlinePage: null, | ||
@@ -30,0 +31,0 @@ offlineAssets: [], |
@@ -13,3 +13,3 @@ const path = require('path') | ||
if (options.dev) { | ||
console.warn('`workbox.dev` enabled. Remember to clean application data and unregister service workers in your browser or you will experience infinity loop!') | ||
console.warn('Workbox running in `dev` mode. Please clear browser cache and prevent using this option for production!') | ||
} | ||
@@ -20,5 +20,5 @@ | ||
this.addPlugin({ | ||
src: path.resolve(__dirname, '../templates/sw.register.js'), | ||
src: path.resolve(__dirname, '../templates/workbox.js'), | ||
ssr: false, | ||
fileName: 'sw.register.js', | ||
fileName: 'workbox.js', | ||
options: { | ||
@@ -25,0 +25,0 @@ ...options |
@@ -6,4 +6,2 @@ const path = require('path') | ||
const HMRRegex = '(?!.*(__webpack_hmr|hot-update))' | ||
function getOptions (moduleOptions) { | ||
@@ -44,3 +42,3 @@ const options = Object.assign({}, defaults, moduleOptions, this.options.workbox) | ||
if (!options.assetsURLPattern) { | ||
options.assetsURLPattern = joinUrl(options.publicPath, HMRRegex) | ||
options.assetsURLPattern = options.publicPath | ||
} | ||
@@ -50,3 +48,3 @@ if (options.cacheAssets) { | ||
urlPattern: options.assetsURLPattern, | ||
handler: 'CacheFirst' | ||
handler: this.options.dev ? 'NetworkFirst' : 'CacheFirst' | ||
}) | ||
@@ -57,3 +55,3 @@ } | ||
if (!options.pagesURLPattern) { | ||
options.pagesURLPattern = joinUrl(options.routerBase, HMRRegex) | ||
options.pagesURLPattern = options.routerBase | ||
} | ||
@@ -63,3 +61,3 @@ if (options.offline && !options.offlinePage) { | ||
urlPattern: options.pagesURLPattern, | ||
handler: 'NetworkFirst' | ||
handler: options.offlineStrategy | ||
}) | ||
@@ -66,0 +64,0 @@ } |
{ | ||
"name": "@nuxtjs/workbox", | ||
"version": "3.0.0-beta.14", | ||
"version": "3.0.0-beta.15", | ||
"license": "MIT", | ||
@@ -11,6 +11,6 @@ "main": "lib/module.js", | ||
"dependencies": { | ||
"@nuxtjs/pwa-utils": "3.0.0-beta.14", | ||
"workbox-cdn": "^4.1.1" | ||
"@nuxtjs/pwa-utils": "3.0.0-beta.15", | ||
"workbox-cdn": "^4.3.1" | ||
}, | ||
"gitHead": "09d65845a61c9b01304326e7db60e89ff9d60e07" | ||
"gitHead": "558b086eb65757459349a05e1483c5b418d46b6b" | ||
} |
@@ -66,3 +66,3 @@ importScripts(<%= [options.workboxURL, ...options.importScripts].map((i) => `'${i}'`).join(', ') %>) | ||
workbox.routing.registerRoute(new RegExp('<%= options.pagesURLPattern %>'), ({event}) => { | ||
return new workbox.strategies.NetworkOnly().handle({event}) | ||
return new workbox.strategies.<%= options.offlineStrategy %>().handle({event}) | ||
.catch(() => caches.match('<%= options.offlinePage %>')) | ||
@@ -69,0 +69,0 @@ })<% } %> |
16837
+ Added@nuxtjs/pwa-utils@3.0.0-beta.15(transitive)
- Removed@nuxtjs/pwa-utils@3.0.0-beta.14(transitive)
Updatedworkbox-cdn@^4.3.1