Skip to content

Commit

Permalink
feat: add option to register third-party sw (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkside73 authored and pi0 committed Nov 16, 2017
1 parent 405db3e commit 9c0b61e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/workbox/index.js
Expand Up @@ -62,11 +62,12 @@ module.exports = function nuxtWorkbox (options) {
})

// Register runtime plugin
const swURL = `${routerBase}/${options.swURL || swFileName}`
this.addPlugin({
src: path.resolve(__dirname, 'plugin.js'),
ssr: false,
options: {
swURL: fixUrl(`${routerBase}/${swFileName}`),
swURL: fixUrl(swURL),
swScope: fixUrl(`${routerBase}/`)
}
})
Expand Down

0 comments on commit 9c0b61e

Please sign in to comment.