From 1940ca2ad45b95e07caa3db4eef44c7c30cf21ac Mon Sep 17 00:00:00 2001 From: Waleed Khaled Date: Thu, 4 Jan 2024 21:16:43 +0400 Subject: [PATCH] fix: server restart config load issue --- src/node/plugin.ts | 7 ++++++- src/node/server.ts | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index a386fe2cf53c..033434e724e5 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -382,7 +382,12 @@ export async function createVitePressPlugin( ) try { - await resolveUserConfig(siteConfig.root, 'serve', 'development') + await resolveUserConfig( + siteConfig.root, + 'serve', + 'development', + configPath ? path.relative(process.cwd(), configPath) : configPath + ) } catch (err: any) { return } diff --git a/src/node/server.ts b/src/node/server.ts index dd3f6d8ae655..779cdfc00d29 100644 --- a/src/node/server.ts +++ b/src/node/server.ts @@ -13,7 +13,6 @@ export async function createServer( 'development', serverOptions.configFile ) - delete serverOptions.configFile if (serverOptions.base) { config.site.base = serverOptions.base