Skip to content

docs(devserver): webpack-dev-server open new option type #3671

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 4 commits into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/content/configuration/dev-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ module.exports = {

## `devServer.open`

`boolean = false` `string`
`boolean = false` `string` `object`

Tells dev-server to open the browser after server had been started. Set it to `true` to open your default browser.

Expand Down Expand Up @@ -861,6 +861,21 @@ module.exports = {
};
```

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](https://www.npmjs.com/package/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 flags you want to use. For example:

__webpack.config.js__

```javascript
module.exports = {
//...
devServer: {
open: {
app: ['Google Chrome', '--incognito', '--other-flag']
}
}
};
```

Usage via the CLI

```bash
Expand Down