From 236dca17a9875d9180ed0d2aafb1d8a3278c7976 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Wed, 27 Nov 2019 15:07:37 +0800 Subject: [PATCH] fix($plugin-pwa): no global-ui-component when updatePopup is disabled --- 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 0bbf49e393..074d606d5b 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'),