Commit 4dc7c865 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub
Browse files

Prefer localhost as an address (#2154)

parent 281e8d23
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 14 additions and 1 deletion
+14 -1
...@@ -60,6 +60,19 @@ function run(port) { ...@@ -60,6 +60,19 @@ function run(port) {
pathname: '/', pathname: '/',
}); });
let prettyHost;
if (HOST === '0.0.0.0' || HOST === '::') {
prettyHost = 'localhost';
} else {
prettyHost = HOST;
}
const prettyUrl = url.format({
protocol,
hostname: prettyHost,
port,
pathname: '/',
});
// Create a webpack compiler that is configured with custom messages. // Create a webpack compiler that is configured with custom messages.
const compiler = createWebpackCompiler( const compiler = createWebpackCompiler(
config, config,
...@@ -100,7 +113,7 @@ function run(port) { ...@@ -100,7 +113,7 @@ function run(port) {
console.log(chalk.cyan('Starting the development server...')); console.log(chalk.cyan('Starting the development server...'));
console.log(); console.log();
openBrowser(formattedUrl); openBrowser(prettyUrl);
}); });
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment