Skip to content

Commit

Permalink
feat(workbox): option to enable skipWaiting (#80)
Browse files Browse the repository at this point in the history
Co-authored-by: galvez <jonasgalvez@gmail.com>
  • Loading branch information
2 people authored and pi0 committed Aug 24, 2018
1 parent 36e5f01 commit 88cc602
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/workbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function getOptions (moduleOptions) {
routingExtensions: null,
cacheId: process.env.npm_package_name || 'nuxt',
clientsClaim: true,
skipWaiting: true,
globPatterns: ['**/*.{js,css}'],
globDirectory: path.resolve(this.options.buildDir, 'dist'),
modifyUrlPrefix: {
Expand Down Expand Up @@ -124,6 +125,7 @@ function addTemplates (options) {
method: i.method || 'GET'
}))),
clientsClaim: options.clientsClaim,
skipWaiting: options.skipWaiting,
wbOptions: {
cacheId: options.cacheId,
directoryIndex: options.directoryIndex,
Expand Down
1 change: 1 addition & 0 deletions packages/workbox/templates/sw.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ workbox.precaching.precacheAndRoute([], <%= JSON.stringify(options.wbOptions, nu
<% if (options.offlinePage) { %>workbox.precaching.precacheAndRoute(['<%= options.offlinePage %>'])<% } %>
<% if (options.cachingExtensions) { %><%= options.cachingExtensions %><% } %>
<% if (options.clientsClaim) { %>workbox.clientsClaim()<% } %>
<% if (options.skipWaiting) { %>workbox.skipWaiting()<% } %>

<%
options.runtimeCaching.forEach(r => {
Expand Down

0 comments on commit 88cc602

Please sign in to comment.