-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
docs(devserver): webpack-dev-server open new option type #3671
docs(devserver): webpack-dev-server open new option type #3671
Conversation
@@ -844,6 +844,21 @@ module.exports = { | |||
}; | |||
``` | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 have
app 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this sounds much better! Looks good, can you commit this?
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.
@EugeneHlushko Check my last commit 😄
Thanks! |
Documentation for this PR : webpack/webpack-dev-server#2492 in webpack dev server