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

Typo/misleading docs re: webpack-dev-server #3601

Open
njwest opened this issue Mar 9, 2019 · 6 comments
Open

Typo/misleading docs re: webpack-dev-server #3601

njwest opened this issue Mar 9, 2019 · 6 comments

Comments

@njwest
Copy link

njwest commented Mar 9, 2019

Version

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

@njwest
Copy link
Author

njwest commented Mar 9, 2019

related to webpack/webpack-dev-server#1712

@LinusBorg
Copy link
Member

LinusBorg commented Mar 9, 2019

Well, the options file doesn't support any cli-only flags, just like a normal webpack config file doesn't.

I don't see anything misleading about that. CLI-only options can only be used as CLI options for webpack dev server.

@njwest
Copy link
Author

njwest commented Mar 10, 2019

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

@igorer88
Copy link

The open option isn't supported neither. :/

@LinusBorg
Copy link
Member

But there's an --open flag for the serve command

@igorer88
Copy link

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.

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

No branches or pull requests

3 participants