diff --git a/src/node/config.ts b/src/node/config.ts index 3434f467..4281e053 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -47,7 +47,7 @@ export async function resolveConfig( root: string = process.cwd() ): Promise { const userConfig = await resolveUserConfig(root) - const site = await resolveSiteData(root) + const site = await resolveSiteData(root, userConfig) // resolve theme path const userThemeDir = resolve(root, 'theme') @@ -90,9 +90,11 @@ export async function resolveUserConfig(root: string) { return userConfig } -export async function resolveSiteData(root: string): Promise { - const userConfig = await resolveUserConfig(root) - +export async function resolveSiteData( + root: string, + userConfig?: UserConfig +): Promise { + userConfig = userConfig || (await resolveUserConfig(root)) return { lang: userConfig.lang || 'en-US', title: userConfig.title || 'VitePress',