diff --git a/lib/prepare.js b/lib/prepare.js index 2dbcfadfbc..9ce48289ce 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -63,10 +63,18 @@ if (!Object.assign) Object.assign = require('object-assign')` // 6. handle enhanceApp.js const enhanceAppPath = path.resolve(sourceDir, '.vuepress/enhanceApp.js') - writeEnhanceTemp('enhanceApp.js', enhanceAppPath, fs.existsSync(enhanceAppPath)) + writeEnhanceTemp( + 'enhanceApp.js', + enhanceAppPath, + fs.existsSync(enhanceAppPath) + ) - // 7. handle the theme index.js - writeEnhanceTemp('themeEnhanceApp.js', options.themeApp, fs.existsSync(options.themeApp)) + // 7. handle the theme enhanceApp.js + writeEnhanceTemp( + 'themeEnhanceApp.js', + options.themeEnhanceAppPath, + fs.existsSync(options.themeEnhanceAppPath) + ) return options } @@ -167,9 +175,9 @@ async function resolveOptions (sourceDir) { options.notFoundPath = path.resolve(__dirname, 'default-theme/NotFound.vue') } - const themeApp = path.resolve(themeDir, 'index.js') - if (fs.existsSync(themeApp)) { - options.themeApp = themeApp + const themeEnhanceAppPath = path.resolve(themeDir, 'index.js') + if (fs.existsSync(themeEnhanceAppPath)) { + options.themeEnhanceAppPath = themeEnhanceAppPath } }