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
281e8d23
Unverified
Commit
281e8d23
authored
7 years ago
by
Joe Haddad
Browse files
Options
Download
Email Patches
Plain Diff
Add support for IPv6 hosts
parent
71a27c0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-dev-utils/prepareProxy.js
+3
-1
packages/react-dev-utils/prepareProxy.js
packages/react-scripts/scripts/start.js
+9
-2
packages/react-scripts/scripts/start.js
with
12 additions
and
3 deletions
+12
-3
packages/react-dev-utils/prepareProxy.js
+
3
-
1
View file @
281e8d23
...
...
@@ -73,7 +73,9 @@ module.exports = function prepareProxy(proxy) {
// `proxy` lets you specify alternate servers for specific requests.
// It can either be a string or an object conforming to the Webpack dev server proxy configuration
// https://webpack.github.io/docs/webpack-dev-server.html
if
(
!
proxy
)
return
undefined
;
if
(
!
proxy
)
{
return
undefined
;
}
if
(
typeof
proxy
!==
'
object
'
&&
typeof
proxy
!==
'
string
'
)
{
console
.
log
(
chalk
.
red
(
...
...
This diff is collapsed.
Click to expand it.
packages/react-scripts/scripts/start.js
+
9
-
2
View file @
281e8d23
...
...
@@ -36,6 +36,7 @@ const config = require('../config/webpack.config.dev');
const
devServerConfig
=
require
(
'
../config/webpackDevServer.config
'
);
const
createWebpackCompiler
=
require
(
'
./utils/createWebpackCompiler
'
);
const
prepareProxy
=
require
(
'
react-dev-utils/prepareProxy
'
);
const
url
=
require
(
'
url
'
);
const
useYarn
=
fs
.
existsSync
(
paths
.
yarnLockFile
);
const
cli
=
useYarn
?
'
yarn
'
:
'
npm
'
;
...
...
@@ -52,6 +53,12 @@ const HOST = process.env.HOST || '0.0.0.0';
function
run
(
port
)
{
const
protocol
=
process
.
env
.
HTTPS
===
'
true
'
?
'
https
'
:
'
http
'
;
const
formattedUrl
=
url
.
format
({
protocol
,
hostname
:
HOST
,
port
,
pathname
:
'
/
'
,
});
// Create a webpack compiler that is configured with custom messages.
const
compiler
=
createWebpackCompiler
(
...
...
@@ -63,7 +70,7 @@ function run(port) {
console
.
log
();
console
.
log
(
'
The app is running at:
'
);
console
.
log
();
console
.
log
(
`
${
chalk
.
cyan
(
`
${
protocol
}
://
${
HOST
}
:
${
port
}
/`
)}
`
);
console
.
log
(
`
${
chalk
.
cyan
(
formattedUrl
)}
`
);
console
.
log
();
console
.
log
(
'
Note that the development build is not optimized.
'
);
console
.
log
(
...
...
@@ -93,7 +100,7 @@ function run(port) {
console
.
log
(
chalk
.
cyan
(
'
Starting the development server...
'
));
console
.
log
();
openBrowser
(
`
${
protocol
}
://
${
HOST
}
:
${
port
}
/`
);
openBrowser
(
formattedUrl
);
});
}
...
...
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