Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit aeabbdc

Browse files
Stop create-react-app from opening an extra browser tab (pointed to the wrong port)
1 parent 96d7f85 commit aeabbdc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Microsoft.AspNetCore.SpaServices.Extensions/ReactDevelopmentServer/ReactDevelopmentServerMiddleware.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ private static async Task<int> StartCreateReactAppServerAsync(
5959

6060
var envVars = new Dictionary<string, string>
6161
{
62-
{ "PORT", portNumber.ToString() }
62+
{ "PORT", portNumber.ToString() },
63+
{ "BROWSER", "none" }, // We don't want create-react-app to open its own extra browser window pointing to the internal dev server port
6364
};
6465
var npmScriptRunner = new NpmScriptRunner(
6566
sourcePath, npmScriptName, null, envVars);

0 commit comments

Comments
 (0)