From 0d56a9908574e0dd7e8b215787ac6ab01e589f11 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Mon, 18 Feb 2019 23:46:15 +0800 Subject: [PATCH] fix($plugin-pwa): service worker doesn't work under sub directory (close: #1311) --- packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js b/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js index d9c365d6e9..8a151b2316 100644 --- a/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js +++ b/packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js @@ -16,7 +16,7 @@ export default ({ router, isServer }) => { && !isServer && SW_ENABLED) { register(`${SW_BASE_URL}service-worker.js`, { - registrationOptions: { scope: `./${SW_BASE_URL}` }, + registrationOptions: {}, ready () { console.log('[vuepress:sw] Service worker is active.') event.$emit('sw-ready')