Skip to content

Commit a0d9600

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(config) shape up devServer.open in response to issue 2869 (#2886)
1 parent b659acc commit a0d9600

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

src/content/configuration/dev-server.md

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,9 @@ module.exports = {
625625

626626
## `devServer.open`
627627

628-
`boolean` `string`
628+
`boolean: false` `string`
629629

630-
Tells dev-server to open the browser after server had been started. Disabled by default.
630+
Tells dev-server to open the browser after server had been started. Set it to `true` to open your default browser.
631631

632632
__webpack.config.js__
633633

@@ -640,43 +640,26 @@ module.exports = {
640640
};
641641
```
642642

643-
If no browser is provided (as shown above), your default browser will be used. To specify a different browser, just pass its name instead of boolean:
644-
645-
```javascript
646-
module.exports = {
647-
//...
648-
devServer: {
649-
open: 'Google Chrome'
650-
}
651-
};
652-
```
653-
654-
Usage via the CLI
655-
656-
```bash
657-
webpack-dev-server --open
658-
```
659-
660-
Or with specified browser:
643+
Provide browser name to use instead of the default one:
661644

662645
__webpack.config.js__
663646

664647
```javascript
665648
module.exports = {
666649
//...
667650
devServer: {
668-
open: 'Chrome'
651+
open: 'Google Chrome'
669652
}
670653
};
671654
```
672655

673-
And via the CLI
656+
Usage via the CLI
674657

675658
```bash
676-
webpack-dev-server --open 'Chrome'
659+
webpack-dev-server --open 'Google Chrome'
677660
```
678661

679-
T> The browser application name is platform dependent. Don't hard code it in reusable modules. For example, `'Chrome'` is Google Chrome on macOS, `'google-chrome'` on Linux and `'chrome'` on Windows.
662+
T> The browser application name is platform dependent. Don't hard code it in reusable modules. For example, `'Chrome'` is `'Google Chrome'` on macOS, `'google-chrome'` on Linux and `'chrome'` on Windows.
680663

681664

682665
## `devServer.openPage`

0 commit comments

Comments
 (0)