Skip to content

Commit

Permalink
feat($core): support async function exported in vuepress config (close:
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMuzatko authored and ulivz committed Oct 11, 2019
1 parent 1f3e4e2 commit cdbfd75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/@vuepress/core/lib/node/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ module.exports = class App {
/**
* Resolve user config and initialize.
*
* @returns {void}
* @returns {Promise<void>}
* @api private
*/

resolveConfigAndInitialize () {
async resolveConfigAndInitialize () {
if (this.options.siteConfig) {
this.siteConfig = this.options.siteConfig
} else {
let siteConfig = loadConfig(this.vuepressDir)
if (isFunction(siteConfig)) {
siteConfig = siteConfig(this)
siteConfig = await siteConfig(this)
}
this.siteConfig = siteConfig
}
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = class App {
*/

async process () {
this.resolveConfigAndInitialize()
await this.resolveConfigAndInitialize()
this.normalizeHeadTagUrls()
this.themeAPI = loadTheme(this)
this.resolveTemplates()
Expand Down

0 comments on commit cdbfd75

Please sign in to comment.