-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve host output and fix open #2892
Changes from all commits
a39d273
e922041
32d79d5
998bccc
884bf6e
a5a89c5
2846faa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,27 +8,27 @@ function createDomain(options, server) { | |
// use location hostname and port by default in createSocketUrl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WIth There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think logic for terminal output and for entries is different, it is similar in some places, but it is for different purpose |
||
// ipv6 detection is not required as 0.0.0.0 is just used as a placeholder | ||
let hostname; | ||
|
||
if (options.useLocalIp) { | ||
hostname = ip.v4.sync() || '0.0.0.0'; | ||
} else if (server) { | ||
hostname = server.address().address; | ||
} else { | ||
hostname = '0.0.0.0'; | ||
} | ||
|
||
const port = server ? server.address().port : 0; | ||
|
||
// use explicitly defined public url | ||
// (prefix with protocol if not explicitly given) | ||
if (options.public) { | ||
return /^[a-zA-Z]+:\/\//.test(options.public) | ||
? `${options.public}` | ||
: `${protocol}://${options.public}`; | ||
} | ||
|
||
// the formatted domain (url without path) of the webpack server | ||
return url.format({ | ||
protocol, | ||
hostname, | ||
port, | ||
}); | ||
return url.format({ protocol, hostname, port }); | ||
} | ||
|
||
module.exports = createDomain; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CLI --hot webpack 4 1`] = ` | ||
"<i> [webpack-dev-server] Project is running at http://127.0.0.1:8080/ | ||
"<i> [webpack-dev-server] Project is running at http://localhost:8080/ | ||
<i> [webpack-dev-middleware] Hash: X | ||
<i> Version: webpack x.x.x Time: Xms | ||
<i> Built at: Thu Jan 01 1970 <CLR=BOLD>00:00:00</CLR> GMT | ||
|
@@ -28,7 +28,7 @@ exports[`CLI --hot webpack 4 1`] = ` | |
`; | ||
|
||
exports[`CLI --hot webpack 5 1`] = ` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note snapshots should be updated twice, each for webpack 4 and 5. |
||
"<i> [webpack-dev-server] Project is running at http://127.0.0.1:8080/ | ||
"<i> [webpack-dev-server] Project is running at http://localhost:8080/ | ||
<i> [webpack-dev-middleware] asset main.js X KiB [emitted] (name: main) | ||
<i> runtime modules X KiB 10 modules | ||
<i> cacheable modules X KiB | ||
|
@@ -46,7 +46,7 @@ exports[`CLI --hot webpack 5 1`] = ` | |
`; | ||
|
||
exports[`CLI --no-hot webpack 4 1`] = ` | ||
"<i> [webpack-dev-server] Project is running at http://127.0.0.1:8080/ | ||
"<i> [webpack-dev-server] Project is running at http://localhost:8080/ | ||
<i> [webpack-dev-middleware] Hash: X | ||
<i> Version: webpack x.x.x Time: Xms | ||
<i> Built at: Thu Jan 01 1970 <CLR=BOLD>00:00:00</CLR> GMT | ||
|
@@ -73,7 +73,7 @@ exports[`CLI --no-hot webpack 4 1`] = ` | |
`; | ||
|
||
exports[`CLI --no-hot webpack 5 1`] = ` | ||
"<i> [webpack-dev-server] Project is running at http://127.0.0.1:8080/ | ||
"<i> [webpack-dev-server] Project is running at http://localhost:8080/ | ||
<i> [webpack-dev-middleware] asset main.js X KiB [emitted] (name: main) | ||
<i> runtime modules X bytes 3 modules | ||
<i> cacheable modules X KiB | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-akait looks like
this.options.info
should be replaced withthis.logger.info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed in master