From 23a85d907443f40560fef93078c425887e059adb Mon Sep 17 00:00:00 2001 From: endiliey Date: Fri, 24 Aug 2018 00:05:37 +0800 Subject: [PATCH] fix: hot reload port should not be hardcoded in case it is used --- lib/commands/start.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/commands/start.js b/lib/commands/start.js index 9550eab7c1..5b7a96e831 100644 --- a/lib/commands/start.js +++ b/lib/commands/start.js @@ -50,6 +50,7 @@ module.exports = async function start(siteDir, cliOptions = {}) { } const port = await getPort(cliOptions.port); + const hotPort = await getPort(port + 1); const {baseUrl} = props; // create compiler from generated webpack config @@ -79,7 +80,7 @@ module.exports = async function start(siteDir, cliOptions = {}) { logLevel: 'silent' }, hotClient: { - port: port + 1, + port: hotPort, logLevel: 'error' }, logLevel: 'error',