From cdbfd757ac1494f720a5717cbc2416031f2ceea9 Mon Sep 17 00:00:00 2001 From: Martin Muzatko Date: Fri, 11 Oct 2019 23:49:20 +0200 Subject: [PATCH] feat($core): support async function exported in vuepress config (close: #1185) (#1925) --- packages/@vuepress/core/lib/node/App.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@vuepress/core/lib/node/App.js b/packages/@vuepress/core/lib/node/App.js index d5f1d46fc6..1fdc615785 100755 --- a/packages/@vuepress/core/lib/node/App.js +++ b/packages/@vuepress/core/lib/node/App.js @@ -56,17 +56,17 @@ module.exports = class App { /** * Resolve user config and initialize. * - * @returns {void} + * @returns {Promise} * @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 } @@ -95,7 +95,7 @@ module.exports = class App { */ async process () { - this.resolveConfigAndInitialize() + await this.resolveConfigAndInitialize() this.normalizeHeadTagUrls() this.themeAPI = loadTheme(this) this.resolveTemplates()