Typo/misleading docs re: webpack-dev-server
See original GitHub issueVersion
3.5.0
Reproduction link
https://gist.github.com/njwest/93922d4eddb9f440b57f0c68c209c1b9
Environment info
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.10.0/bin/npm
Browsers:
Chrome: 72.0.3626.121
Firefox: 65.0.1
Safari: 12.0.3
npmGlobalPackages:
@vue/cli: 3.5.0
Steps to reproduce
Run any Vue cli generated project with the devServer configuration linked above
What is expected?
Expect server spun up from npm run serve
to shut down when stdin connection closes, as a result of stdin
option on devServer.
What is actually happening?
Without this config, a server spun up continues running in the background after parent process shuts down stdin connection.
With this config, the following error is thrown:
options should NOT have additional properties
ValidationError: webpack Dev Server Invalid Options
The official Vue CLI doc (https://cli.vuejs.org/config/#devserver) says the following about the devServer configuration object:
All options for webpack-dev-server are supported.
Unfortunately this is incorrect, as devServer.stdin (which is CLI-only when running webpack-dev-server) is untouchable via this vue config object, which is problematic for vue-cli generated apps in environments in which a node server is expected to shut down when stdin closes.
Loving Vue CLI, but the lack of a clear way to set this standard stdin behavior disadvantages it vs. straight webpack deployments in certain environments
Thanks for the great software!
related to #1597
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
The misleading part is that it says “All options are supported” with a link to the page containing CLI-only options in a section of the docs that is directly accessible via link – from accessing this via search, I wouldn’t know that it was referring to all options possible in the object file, I would think it was referring to all options in the page linked
This is really part of a larger issue of either not having a clear way to pass CLI flags to webpack-dev-server through vue config, or not having a way to pass standard options to webpack-dev-server other than CLI
Its being read as a boolean type, launching the default one not any other. Passing true or a string is the same, not the browsers as such. The only way I manage to launch a different browser is with a BROWSER env variable + the open option. It works fine for just one browser, but not for more than one. I like Firefox developer for CSS and Vivaldi for JS. And I look how it behaves in both. In gulp it was as easy as just passing an array with the browsers.