Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
4dc7c865
Commit
4dc7c865
authored
7 years ago
by
Joe Haddad
Committed by
GitHub
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Prefer localhost as an address (#2154)
parent
281e8d23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/scripts/start.js
+14
-1
packages/react-scripts/scripts/start.js
with
14 additions
and
1 deletion
+14
-1
packages/react-scripts/scripts/start.js
+
14
-
1
View file @
4dc7c865
...
@@ -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
(
formatted
Url
);
openBrowser
(
pretty
Url
);
});
});
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment