Skip to content

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

Merged
merged 28 commits into from
Aug 1, 2017

Conversation

orteth01
Copy link
Contributor

@orteth01 orteth01 commented Jul 31, 2017

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.

@simon04
Copy link
Collaborator

simon04 commented Jul 31, 2017

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.

@orteth01
Copy link
Contributor Author

"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.

@orteth01 orteth01 force-pushed the dev-server-allowed-hosts-cli branch from 8191e1d to c188572 Compare July 31, 2017 19:18
webpack-dev-server --content-base /path/to/content/dir
```

## `devServer.disableHostCheck`
Copy link
Contributor Author

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.

@orteth01 orteth01 force-pushed the dev-server-allowed-hosts-cli branch from c188572 to 73721b5 Compare July 31, 2017 19:21
@skipjack
Copy link
Collaborator

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).

Copy link
Collaborator

@skipjack skipjack left a 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!

```

Usage via the CLI
```
Copy link
Collaborator

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.

Copy link
Collaborator

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.

```
webpack-dev-server --pfx-passphrase passphrase
```

Copy link
Collaborator

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` 🔑
Copy link
Collaborator

Choose a reason for hiding this comment

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

@simon04 (or @orteth01) do either of you know the purpose of the key icons? Can we drop them?

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

@orteth01
Copy link
Contributor Author

orteth01 commented Jul 31, 2017

there was some discussion there on where this documentation should go.

@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

@skipjack
Copy link
Collaborator

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 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 yargs.options could really be the source of truth for this whole page. However this definitely gets tricky with the need for examples and other more detailed guides/content.

@orteth01 orteth01 force-pushed the dev-server-allowed-hosts-cli branch from 458b240 to c2989f1 Compare July 31, 2017 22:39
@orteth01 orteth01 force-pushed the dev-server-allowed-hosts-cli branch from c2989f1 to 24e4d56 Compare July 31, 2017 22:39
@orteth01 orteth01 changed the title Add documentation for devServer.allowedHosts cli option Add documentation for cli options Jul 31, 2017
@orteth01 orteth01 changed the title Add documentation for cli options Add documentation for devServer cli options Jul 31, 2017
```


## `devServer.disableHostCheck`
Copy link
Contributor Author

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

Copy link
Collaborator

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.

```bash
webpack-dev-server --info=false
```


## `devServer.inline` - CLI only
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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!

Copy link
Collaborator

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.

Copy link
Contributor Author

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!

@skipjack skipjack merged commit 49208bf into webpack:master Aug 1, 2017
@orteth01 orteth01 deleted the dev-server-allowed-hosts-cli branch August 2, 2017 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants