From 3777845c6f71b462da4637c461a728dff8b5c6b8 Mon Sep 17 00:00:00 2001 From: Martin Muzatko Date: Tue, 8 Oct 2019 10:56:30 +0200 Subject: [PATCH 1/2] feat: support async function exported in vuepress config --- packages/@vuepress/core/lib/node/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@vuepress/core/lib/node/App.js b/packages/@vuepress/core/lib/node/App.js index 60b186da3b..3e168a7e92 100755 --- a/packages/@vuepress/core/lib/node/App.js +++ b/packages/@vuepress/core/lib/node/App.js @@ -60,13 +60,13 @@ module.exports = class App { * @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() From 2c49e335cbb023cd25b3c80f9a0cd69fc7f2ae75 Mon Sep 17 00:00:00 2001 From: Martin Muzatko Date: Tue, 8 Oct 2019 11:40:45 +0200 Subject: [PATCH 2/2] chore: update inline code documentation for resolveConfigAndInitialize --- packages/@vuepress/core/lib/node/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vuepress/core/lib/node/App.js b/packages/@vuepress/core/lib/node/App.js index 3e168a7e92..ec7e1d8256 100755 --- a/packages/@vuepress/core/lib/node/App.js +++ b/packages/@vuepress/core/lib/node/App.js @@ -56,7 +56,7 @@ module.exports = class App { /** * Resolve user config and initialize. * - * @returns {void} + * @returns {Promise} * @api private */