-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable picking truly random port in serve mode #3692
Comments
So I just have to modify this right: |
It is somewhat tricky - I think we want to preserve default behavior of keeping the port in familiar range of |
Thanks for the feedback, should i pr my changes or leave it |
Not sure, @evanw could you comment on this issue? Need your confirmation before exploring solutions. |
Hey yo i did this pr #3693 and i also tested locally which was confusing to setup and test but it has the random functionality |
I can do this but making the port nullable in the Go API is a breaking change, so it'll have to wait until a breaking change release to do it. Adding the |
K |
I'm not sure that this is necessary. What is the reason to have a random port from the full range instead of a random port from a narrow range? I'm not sure why it would be ideal for esbuild to do that. What happens now because esbuild doesn't do that? |
There is only a slight semantic benefit - I have a library (https://github.com/ptrdom/scalajs-esbuild) where I am running esbuild behind a proxy, basically the setup of https://esbuild.github.io/api/#serve-proxy, so I would like to put This is not something that other build tools provide - What do you think about this? |
Currently there is no way to tell esbuild to pick a truly random port in serve mode - if
port
is unset or set to0
then port in8000-8009
range gets picked up. Ideally ifport
is set to0
then this would just be passed to Golisten
implementation and it would pick a free random port.The text was updated successfully, but these errors were encountered: