Repository navigation
docs(devserver): webpack-dev-server open new option type - #3671
Conversation
| }; | ||
| ``` | ||
|
|
||
| Sometimes you may want to use some options when opening the browser like opening an incognito window. In order to do that you can set `open` to an object. The object must have `app` property as an array. The first element in the array must be the browser name and the other following elements are the options you want. For example: |
There was a problem hiding this comment.
This is very abstract in the beginning. Need to make it more of a documentation level e.g. remove Sometimes... Say clearly what you can achieve or what is allowed when passing object to devServer.open.
Is app the only key allowed in this object?
There was a problem hiding this comment.
what about : If you want to use some switches when opening the browser like opening an incognito window (--incognito switch), you can set opento an object. The object must haveapp property as an array. The first element in the array must be the browser name and the other following elements are the switches you want. For example:
No, all options in https://www.npmjs.com/package/open will work.
There was a problem hiding this comment.
Yeah its better! But, what i really dont like, is saying things like various some maybe potentially in the documentation. If you can get rid of that would be even better.
Another point is the word switches, could be arguments or options ? They are common to the notation --something in CLIs
Can you also add a sentence about that all the options from open can go inside the object, you can also include that link
There was a problem hiding this comment.
@EugeneHlushko I think flags is the right word to use here, using arguments gives me the feeling that --something must have a value and options would cause confusion, It will be mixed by settings, the final result would be :
If you want to use flags when opening the browser like opening an incognito window (--incognito flag), you can set open to an object. The object accepts all open options, app property must be an array. The first element in the array must be the browser name and the other following elements are the options you want. For example:
webpack.config.js
module.exports = {
//...
devServer: {
open: {
app: ['Google Chrome','--incognito','--other-flag']
}
}
};There was a problem hiding this comment.
Yes this sounds much better! Looks good, can you commit this?
|
Thanks! |
Documentation for this PR : webpack/webpack-dev-server#2492 in webpack dev server