Skip to content

Commit f5544bd

Browse files
authored
docs(configuration): add more commands for devServer (#5323)
1 parent de5b7ce commit f5544bd

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

src/content/configuration/dev-server.mdx

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ Usage via the CLI:
163163
npx webpack serve --bonjour
164164
```
165165

166+
To disable:
167+
168+
```bash
169+
npx webpack serve --no-bonjour
170+
```
171+
166172
You can also pass [custom options](https://github.com/watson/bonjour#initializing) to bonjour, for example:
167173

168174
**webpack.config.js**
@@ -231,6 +237,12 @@ Usage via the CLI:
231237
npx webpack serve --client-overlay
232238
```
233239

240+
To disable:
241+
242+
```bash
243+
npx webpack serve --no-client-overlay
244+
```
245+
234246
If you want to show only errors:
235247

236248
**webpack.config.js**
@@ -278,6 +290,12 @@ Usage via the CLI:
278290
npx webpack serve --client-progress
279291
```
280292

293+
To disable:
294+
295+
```bash
296+
npx webpack serve --no-client-progress
297+
```
298+
281299
### webSocketTransport
282300

283301
`'ws' | 'sockjs'` `string`
@@ -421,6 +439,12 @@ Usage via the CLI:
421439
npx webpack serve --compress
422440
```
423441

442+
To disable:
443+
444+
```bash
445+
npx webpack serve --no-compress
446+
```
447+
424448
## devserver.devMiddleware
425449

426450
Provide options to [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) which handles webpack assets.
@@ -482,7 +506,13 @@ Usage via CLI
482506
npx webpack serve --http2
483507
```
484508

485-
To pass your own certificate via CLI, use the following options
509+
To disable:
510+
511+
```bash
512+
npx webpack serve --no-http2
513+
```
514+
515+
To pass your own certificate via CLI, use the following options:
486516

487517
```bash
488518
npx webpack serve --http2 --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-cacert ./path/to/ca.pem
@@ -532,7 +562,13 @@ Usage via the CLI:
532562
npx webpack serve --https
533563
```
534564

535-
To pass your own certificate via the CLI use the following options
565+
To disable:
566+
567+
```bash
568+
npx webpack serve --no-https
569+
```
570+
571+
To pass your own certificate via the CLI use the following options:
536572

537573
```bash
538574
npx webpack serve --https-key ./path/to/server.key --https--cert ./path/to/server.crt --https-cacert ./path/to/ca.pem
@@ -614,6 +650,12 @@ Usage via the CLI:
614650
npx webpack serve --history-api-fallback
615651
```
616652

653+
To disable:
654+
655+
```bash
656+
npx webpack serve --no-history-api-fallback
657+
```
658+
617659
For more options and information, see the [connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback) documentation.
618660

619661
## devServer.host
@@ -692,6 +734,12 @@ Usage via the CLI:
692734
npx webpack serve --hot
693735
```
694736

737+
To disable:
738+
739+
```bash
740+
npx webpack serve --no-hot
741+
```
742+
695743
To enable Hot Module Replacement without page refresh as a fallback in case of build failures, use `hot: 'only'`:
696744

697745
**webpack.config.js**
@@ -884,6 +932,12 @@ Usage via the CLI:
884932
npx webpack serve --open
885933
```
886934

935+
To disable:
936+
937+
```bash
938+
npx webpack serve --no-open
939+
```
940+
887941
To open a specified page in browser:
888942

889943
**webpack.config.js**

0 commit comments

Comments
 (0)