提交 b6688754 编写于 作者: E Evan You

refactor: load theme/enhanceApp.js instead of index.js

上级 2f0da010
......@@ -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
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册