From d0dcf221018cf2c364bc00ff6f750146eb048e7d Mon Sep 17 00:00:00 2001 From: Michael Hays Date: Thu, 8 Apr 2021 18:00:07 -0700 Subject: [PATCH] fix(vite-dev-server): Use viteConfig.server.port if defined (#15893) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Barthélémy Ledoux --- npm/vite-dev-server/src/startServer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/vite-dev-server/src/startServer.ts b/npm/vite-dev-server/src/startServer.ts index 324a026802d6..8ce3c92656fd 100644 --- a/npm/vite-dev-server/src/startServer.ts +++ b/npm/vite-dev-server/src/startServer.ts @@ -43,7 +43,7 @@ const resolveServerConfig = async ({ viteConfig, options }: StartDevServer): Pro finalConfig.server = finalConfig.server || {} - finalConfig.server.port = await getPort({ port: 3000, host: 'localhost' }), + finalConfig.server.port = await getPort({ port: finalConfig.server.port || 3000, host: 'localhost' }), debug(`the resolved server config is ${JSON.stringify(finalConfig, null, 2)}`)