-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add documentation for devServer cli options #1468
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
Add documentation for devServer cli options #1468
Conversation
This would be the first CLI option explicitly documented for webpack-dev-server. We might want to do the same for all other options in a consistent way? "Flag" typically relates to a Boolean option (it's there or it isn't); I find "option" more adequate. |
i'll update it. I can also take a shot at documenting the other CLI options. |
8191e1d
to
c188572
Compare
content/configuration/dev-server.md
Outdated
webpack-dev-server --content-base /path/to/content/dir | ||
``` | ||
|
||
## `devServer.disableHostCheck` |
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.
was this option intentionally left out of the docs to prevent people from using it? If so, I can remove this.
c188572
to
73721b5
Compare
This overlaps with #1196... there was some discussion there on where this documentation should go. I'm actually ok with small sections below each config example as both as you've done although I think there are some formatting issues (which may be why the build is failing). |
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.
Some minor formatting changes are needed but aside from that this looks good to me. Thanks for your contribution @orteth01!
content/configuration/dev-server.md
Outdated
``` | ||
|
||
Usage via the CLI | ||
``` |
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.
You need to add a line break between each fenced code block and the paragraph above it.
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.
This is why the build is currently failing.
content/configuration/dev-server.md
Outdated
``` | ||
webpack-dev-server --pfx-passphrase passphrase | ||
``` | ||
|
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.
It should be two line breaks between each section -- it seems on some you did add two but at least a few of these only have one.
``` | ||
webpack-dev-server --public myapp.test:80 | ||
``` | ||
|
||
|
||
## `devServer.publicPath` 🔑 |
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.
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.
Or @SpaceK33z? I'm not sure what they're supposed to indicate. If they were meaningful maybe we can think of a more intuitive display.
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.
Options that are compatible with webpack-dev-middleware have 🔑 next to them.
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.
Ah I see, thank you.
@skipjack yea I was originally thinking about creating a separate readme for the CLI but it seemed like that would result in a lot of duplicated explanations of options - that's why I opted to just include CLI usage in the devServer config readme |
Yeah I agree re duplication -- I think at some point, once we've finished reviewing and structuring the documentation on this site we should really start thinking about how more of the documentation can be auto-generated from code comments or other data that provides a single source of truth. This is a perfect example of where this would work well, i.e. that same data being passed to |
458b240
to
c2989f1
Compare
c2989f1
to
24e4d56
Compare
``` | ||
|
||
|
||
## `devServer.disableHostCheck` |
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.
was this option intentionally left out of the docs to prevent people from using it? If so, I can remove this.
commented on an earlier, now-out-of-date commit. just want to make sure this is alright
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.
I think if it's an available option and it's noted by the CLI when running webpack-dev-server -h
then it should be documented here as well. Your "THIS IS NOT RECOMMENDED..." is prominent enough that people should notice this, and if they choose to proceed anyway, so be it.
I'm going to do one last skim and then merge this. @SpaceK33z if you have a chance to review this later on and come across any issues -- please ping us so we can resolve in a separate PR.
content/configuration/dev-server.md
Outdated
```bash | ||
webpack-dev-server --info=false | ||
``` | ||
|
||
|
||
## `devServer.inline` - CLI only |
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.
I think we should drop the "CLI only" flag here as well unless it was removed in a recent version. I've definitely used inline
via the configuration before.
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.
@orteth01 I'm just going to make this change so we can get this merged. Ping me if I'm wrong on this though and we can fix in a separate PR.
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.
@skipjack yea you're totally right. I must have just missed this one. my bad!
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 worries, thanks again for this update! If you don't mind I may ping you in the future if there's other questions re this page since it seems like you have some familiarity with the webpack-dev-server repo.
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.
If you don't mind I may ping you in the future if there's other questions re this page
yea no problem! happy to help!
Originally was just adding documentation for the allowedHosts cli option webpack/webpack-dev-server#1012.
However, because there was no documentation for other CLI options I went ahead and added those too.