From 6f9e478eff7c4bf487da1f278a137466a05d98bf Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Fri, 29 Nov 2019 10:56:26 +0800 Subject: [PATCH] fix($plugin-pwa): no global-ui-component when updatePopup is disabled (#2041) --- packages/@vuepress/plugin-pwa/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@vuepress/plugin-pwa/index.js b/packages/@vuepress/plugin-pwa/index.js index 0bbf49e3..074d606d 100644 --- a/packages/@vuepress/plugin-pwa/index.js +++ b/packages/@vuepress/plugin-pwa/index.js @@ -3,7 +3,8 @@ const { logger, fs, path } = require('@vuepress/shared-utils') module.exports = (options, context) => ({ ready () { options = Object.assign({ - serviceWorker: true + serviceWorker: true, + popupComponent: 'SWUpdatePopup' }, options) }, @@ -26,7 +27,7 @@ module.exports = (options, context) => ({ // { name: 'SWUpdatePopup', path: path.resolve(__dirname, 'lib/SWUpdatePopup.vue') } // ], - globalUIComponents: options.popupComponent || 'SWUpdatePopup', + globalUIComponents: options.updatePopup ? options.popupComponent : undefined, enhanceAppFiles: path.resolve(__dirname, 'lib/enhanceAppFile.js'),