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

cant use watch with servedir error clarification, and node config.js poorly placed in documentation #1650

Closed
janat08 opened this issue Oct 1, 2021 · 2 comments · Fixed by #2816

Comments

@janat08
Copy link

janat08 commented Oct 1, 2021

The better error message there when using watch with servedir flags is that servedir flag is only necessary. I'd also like to point out that I don't think the docs actually mention anywhere near the intro sections that you're suppose to use esbuild with node if using config file which servedir I think requires, therefore you have one of the more common use cases by in large undocumented in getting started.

@janat08 janat08 changed the title cant use watch with servedir error clarification cant use watch with servedir error clarification, and node config.js poorly placed in documentation Oct 1, 2021
@evanw
Copy link
Owner

evanw commented Oct 4, 2021

The better error message there when using watch with servedir flags is that servedir flag is only necessary

That's not true. The --watch and --servedir flags do different things; watching actively rebuilds when files change while serving only rebuilds when new requests come in. Some people explicitly want to do both (e.g. #805) and are passing --watch expecting it to change the behavior of --servedir. The reason is that these two flags are incompatible, not that --watch is redundant.

you're suppose to use esbuild with node if using config file which servedir I think requires

That's not true. I use esbuild --servedir=. all the time to get a local file server.

@janat08
Copy link
Author

janat08 commented Oct 4, 2021

You think there’s any room for improvement in docs and error messages? The part with servedir having any rebundling behavior I teased out with some difficulty as I accidentally edited wrong file during testing. As far as googling goes having to use node for the config to be read (I don’t remember what makes it necessary) isn’t straightforward. Perhaps the js examples of commands should include a comment about node or at very least sections that deal with commands that must run through the config because the target audience then includes the clueless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants