Skip to content

Commit

Permalink
fix($plugin-pwa): set current registration scope for service worker (c…
Browse files Browse the repository at this point in the history
…lose: #1271) (#1302)
  • Loading branch information
ulivz authored Feb 16, 2019
1 parent c91f55a commit 4b2b0f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default ({ router, isServer }) => {
&& !isServer
&& SW_ENABLED) {
register(`${SW_BASE_URL}service-worker.js`, {
registrationOptions: { scope: `./${SW_BASE_URL}` },
ready () {
console.log('[vuepress:sw] Service worker is active.')
event.$emit('sw-ready')
Expand Down

0 comments on commit 4b2b0f4

Please sign in to comment.