From 4b2b0f482fd8d6a8a2b11ab2298847c0ab223ae4 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 17 Feb 2019 03:47:43 +0800 Subject: [PATCH] fix($plugin-pwa): set current registration scope for service worker (close: #1271) (#1302) --- packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js b/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js index 3054f3d161..d9c365d6e9 100644 --- a/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js +++ b/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js @@ -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')