Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nuxt-community/pwa-module
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.2.0
Choose a base ref
...
head repository: nuxt-community/pwa-module
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.2.1
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Oct 13, 2020

  1. Copy the full SHA
    27e19a0 View commit details
  2. test: update fixture

    pi0 committed Oct 13, 2020
    Copy the full SHA
    1d949f1 View commit details
  3. chore(release): 3.2.1

    pi0 committed Oct 13, 2020
    Copy the full SHA
    1585947 View commit details
Showing with 15 additions and 2 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −0 lib/manifest/module.js
  3. +5 −0 lib/workbox/options.js
  4. +1 −1 package.json
  5. +1 −1 test/__snapshots__/pwa.test.js.snap
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.2.1](https://github.com/nuxt-community/pwa-module/compare/v3.2.0...v3.2.1) (2020-10-13)


### Bug Fixes

* **workbox:** precache `start_url` (resolves [#372](https://github.com/nuxt-community/pwa-module/issues/372)) ([27e19a0](https://github.com/nuxt-community/pwa-module/commit/27e19a04d6f2b14943a0bb4a9b7414382591d4e0))

## [3.2.0](https://github.com/nuxt-community/pwa-module/compare/v3.1.2...v3.2.0) (2020-10-13)


1 change: 1 addition & 0 deletions lib/manifest/module.js
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ module.exports = function nuxtManifest (nuxt, pwa) {
nuxt.options.manifest = {}
}
Object.assign(nuxt.options.manifest, manifest)
Object.assign(pwa.manifest, manifest)

// Register webpack plugin to emit manifest
const manifestSource = JSON.stringify(manifest, null, 2)
5 changes: 5 additions & 0 deletions lib/workbox/options.js
Original file line number Diff line number Diff line change
@@ -61,6 +61,11 @@ function getOptions (nuxt, pwa) {
})
}

// Add start_url to precaching
if (pwa.manifest && pwa.manifest.start_url) {
options.preCaching.unshift(pwa.manifest.start_url)
}

// Add offlineAssets to precaching
if (options.offlineAssets.length) {
options.preCaching.unshift(...options.offlineAssets)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxtjs/pwa",
"version": "3.2.0",
"version": "3.2.1",
"description": "Zero config PWA solution for Nuxt.js",
"repository": "nuxt-community/pwa-module",
"license": "MIT",
2 changes: 1 addition & 1 deletion test/__snapshots__/pwa.test.js.snap
Original file line number Diff line number Diff line change
@@ -142,7 +142,7 @@ exports[`pwa manifest.json 1`] = `
`;

exports[`pwa sw.js 1`] = `
"const options = {\\"workboxURL\\":\\"https://cdn.jsdelivr.net/npm/workbox-cdn/workbox/workbox-sw.js\\",\\"importScripts\\":[\\"custom-sw.js\\"],\\"config\\":{\\"debug\\":true},\\"cacheNames\\":{\\"prefix\\":\\"test\\",\\"googleAnalytics\\":\\"test-ga\\"},\\"clientsClaim\\":true,\\"skipWaiting\\":true,\\"cleanupOutdatedCaches\\":true,\\"offlineAnalytics\\":true,\\"preCaching\\":[\\"precache.js\\"],\\"runtimeCaching\\":[{\\"urlPattern\\":\\"https://google.com/.*\\",\\"handler\\":\\"CacheFirst\\",\\"method\\":\\"GET\\",\\"strategyPlugins\\":[]},{\\"urlPattern\\":\\"https://pwa.nuxtjs.org/.*\\",\\"handler\\":\\"CacheFirst\\",\\"method\\":\\"GET\\",\\"strategyOptions\\":{\\"cacheName\\":\\"nuxt-pwa\\"},\\"strategyPlugins\\":[{\\"use\\":\\"expiration.ExpirationPlugin\\",\\"config\\":[{\\"maxEntries\\":10,\\"maxAgeSeconds\\":300}]}]},{\\"urlPattern\\":\\"/_nuxt/\\",\\"handler\\":\\"CacheFirst\\",\\"method\\":\\"GET\\",\\"strategyPlugins\\":[]},{\\"urlPattern\\":\\"/\\",\\"handler\\":\\"NetworkFirst\\",\\"method\\":\\"GET\\",\\"strategyPlugins\\":[]}],\\"offlinePage\\":null,\\"pagesURLPattern\\":\\"/\\",\\"offlineStrategy\\":\\"NetworkFirst\\"}
"const options = {\\"workboxURL\\":\\"https://cdn.jsdelivr.net/npm/workbox-cdn/workbox/workbox-sw.js\\",\\"importScripts\\":[\\"custom-sw.js\\"],\\"config\\":{\\"debug\\":true},\\"cacheNames\\":{\\"prefix\\":\\"test\\",\\"googleAnalytics\\":\\"test-ga\\"},\\"clientsClaim\\":true,\\"skipWaiting\\":true,\\"cleanupOutdatedCaches\\":true,\\"offlineAnalytics\\":true,\\"preCaching\\":[\\"/?standalone=true\\",\\"precache.js\\"],\\"runtimeCaching\\":[{\\"urlPattern\\":\\"https://google.com/.*\\",\\"handler\\":\\"CacheFirst\\",\\"method\\":\\"GET\\",\\"strategyPlugins\\":[]},{\\"urlPattern\\":\\"https://pwa.nuxtjs.org/.*\\",\\"handler\\":\\"CacheFirst\\",\\"method\\":\\"GET\\",\\"strategyOptions\\":{\\"cacheName\\":\\"nuxt-pwa\\"},\\"strategyPlugins\\":[{\\"use\\":\\"expiration.ExpirationPlugin\\",\\"config\\":[{\\"maxEntries\\":10,\\"maxAgeSeconds\\":300}]}]},{\\"urlPattern\\":\\"/_nuxt/\\",\\"handler\\":\\"CacheFirst\\",\\"method\\":\\"GET\\",\\"strategyPlugins\\":[]},{\\"urlPattern\\":\\"/\\",\\"handler\\":\\"NetworkFirst\\",\\"method\\":\\"GET\\",\\"strategyPlugins\\":[]}],\\"offlinePage\\":null,\\"pagesURLPattern\\":\\"/\\",\\"offlineStrategy\\":\\"NetworkFirst\\"}
importScripts(...[options.workboxURL, ...options.importScripts])