Skip to content
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

fix(serve): do not default host in webpack-dev-server v4 #2141

Merged
merged 1 commit into from
Nov 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/serve/src/startDevServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export default function startDevServer(compiler, cliOptions): object[] {
const usedPorts: number[] = [];
devServerOptions.forEach((devServerOpts): void => {
const options = mergeOptions(cliOptions, devServerOpts);
options.host = options.host || 'localhost';
// devSever v4 handles the default port itself
// devSever v4 handles the default host and port itself
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can break compatibility with webpack-dev-server@3, I think we need do it by default for else branch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDevServer4 is negated in the condition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely need a vacation

if (!isDevServer4) {
options.host = options.host || 'localhost';
options.port = options.port || 8080;
}

Expand Down