From 6de14a2363f5dcb22a1999c92fee65ce048b2b80 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 17 Feb 2019 02:35:29 +0800 Subject: [PATCH] fix($plugin-pwa): set current registration scope for service worker (close: #1271) --- 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')