Files
vuepress/packages/@vuepress/core/lib/internal-plugins/enhanceApp.js
T
2019-02-26 23:53:38 +08:00

18 lines
579 B
JavaScript
Executable File

const { path } = require('@vuepress/shared-utils')
module.exports = (options, context) => ({
name: '@vuepress/internal-enhance-app',
enhanceAppFiles () {
const { sourceDir, themeAPI } = context
const enhanceAppPath = path.resolve(sourceDir, '.vuepress/enhanceApp.js')
const files = [enhanceAppPath]
if (themeAPI.existsParentTheme) {
files.push(path.resolve(themeAPI.parentTheme.path, 'enhanceApp.js'))
}
const themeEnhanceAppPath = path.resolve(themeAPI.theme.path, 'enhanceApp.js')
files.push(themeEnhanceAppPath)
return files
}
})