Skip to content

Commit 4b2b0f4

Browse files
authored
fix($plugin-pwa): set current registration scope for service worker (close: #1271) (#1302)
1 parent c91f55a commit 4b2b0f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default ({ router, isServer }) => {
1616
&& !isServer
1717
&& SW_ENABLED) {
1818
register(`${SW_BASE_URL}service-worker.js`, {
19+
registrationOptions: { scope: `./${SW_BASE_URL}` },
1920
ready () {
2021
console.log('[vuepress:sw] Service worker is active.')
2122
event.$emit('sw-ready')

0 commit comments

Comments
 (0)