-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(dev build): reserving unused port #26 #30
Conversation
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.
Maybe log some warning when the port is changed
lib/dev.js
Outdated
portfinder.basePort = cliOptions.port || options.siteConfig.port || 8080 | ||
const port = await portfinder.getPortPromise() | ||
.then((port) => { | ||
return port |
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.
.then here can be removed if you only want to get the available port.
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.
@ulivz Thanks!!
completely missed it , will fix it now.
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.
no need of .catch
too
lib/dev.js
Outdated
const port = cliOptions.port || options.siteConfig.port || 8080 | ||
portfinder.basePort = cliOptions.port || options.siteConfig.port || 8080 | ||
const port = await portfinder.getPortPromise() | ||
.catch(err => console.log(err)) |
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.
no need to catch here, this should propagate up the call stack and be logged anyway.
…000 as port 8080 was used by webpack
No description provided.