@@ -76,7 +76,7 @@ allowedHosts: [
76
76
77
77
To use this option with the CLI pass the ` --allowed-hosts ` option a comma-delimited string.
78
78
79
- ```
79
+ ``` bash
80
80
webpack-dev-server --entry /entry/file --output-path /output/path --allowed-hosts .host.com,host2.com
81
81
```
82
82
@@ -89,7 +89,8 @@ bonjour: true
89
89
```
90
90
91
91
Usage via the CLI
92
- ```
92
+
93
+ ``` bash
93
94
webpack-dev-server --bonjour
94
95
```
95
96
@@ -106,20 +107,23 @@ clientLogLevel: "none"
106
107
```
107
108
108
109
Usage via the CLI
109
- ```
110
+
111
+ ``` bash
110
112
webpack-dev-server --client-log-level none
111
113
```
112
114
113
115
Possible values are ` none ` , ` error ` , ` warning ` or ` info ` (default).
114
116
115
117
Note that the console will * always* show bundle errors and warnings. This option only effects the message before it.
116
118
119
+
117
120
## ` devServer.color ` - CLI only
118
121
119
122
` boolean `
120
123
121
124
Enables/Disables colors on the console.
122
- ```
125
+
126
+ ``` bash
123
127
webpack-dev-server --color
124
128
```
125
129
@@ -135,10 +139,12 @@ compress: true
135
139
```
136
140
137
141
Usage via the CLI
138
- ```
142
+
143
+ ``` bash
139
144
webpack-dev-server --compress
140
145
```
141
146
147
+
142
148
## ` devServer.contentBase `
143
149
144
150
` boolean ` ` string ` ` array `
@@ -166,10 +172,12 @@ contentBase: false
166
172
```
167
173
168
174
Usage via the CLI
169
- ```
175
+
176
+ ``` bash
170
177
webpack-dev-server --content-base /path/to/content/dir
171
178
```
172
179
180
+
173
181
## ` devServer.disableHostCheck `
174
182
175
183
` boolean `
@@ -181,10 +189,12 @@ disableHostCheck: true
181
189
```
182
190
183
191
Usage via the CLI
184
- ```
192
+
193
+ ``` bash
185
194
webpack-dev-server --disable-host-check
186
195
```
187
196
197
+
188
198
## ` devServer.filename ` 🔑
189
199
190
200
` string `
@@ -248,7 +258,8 @@ historyApiFallback: {
248
258
```
249
259
250
260
Usage via the CLI
251
- ```
261
+
262
+ ``` bash
252
263
webpack-dev-server --history-api-fallback
253
264
```
254
265
@@ -266,7 +277,8 @@ host: "0.0.0.0"
266
277
```
267
278
268
279
Usage via the CLI
269
- ```
280
+
281
+ ``` bash
270
282
webpack-dev-server --host 0.0.0.0
271
283
```
272
284
@@ -295,10 +307,12 @@ hotOnly: true
295
307
```
296
308
297
309
Usage via the CLI
298
- ```
310
+
311
+ ``` bash
299
312
webpack-dev-server --hot-only
300
313
```
301
314
315
+
302
316
## ` devServer.https `
303
317
304
318
` boolean ` ` object `
@@ -322,24 +336,29 @@ https: {
322
336
This object is passed straight to Node.js HTTPS module, so see the [ HTTPS documentation] ( https://nodejs.org/api/https.html ) for more information.
323
337
324
338
Usage via the CLI
325
- ```
339
+
340
+ ``` bash
326
341
webpack-dev-server --https
327
342
```
328
343
329
344
To pass your own certificate via the CLI use the following options
330
- ```
345
+
346
+ ``` bash
331
347
webpack-dev-server --https --key /path/to/server.key --cert /path/to/server.crt --cacert /path/to/ca.pem
332
348
```
333
349
350
+
334
351
## ` devServer.info ` - CLI only
335
352
336
353
` boolean `
337
354
338
355
Output cli information. It is enabled by default.
339
- ```
356
+
357
+ ``` bash
340
358
webpack-dev-server --info=false
341
359
```
342
360
361
+
343
362
## ` devServer.inline ` - CLI only
344
363
345
364
` boolean `
@@ -353,7 +372,8 @@ inline: false
353
372
```
354
373
355
374
Usage via the CLI
356
- ```
375
+
376
+ ``` bash
357
377
webpack-dev-server --inline=false
358
378
```
359
379
@@ -371,7 +391,8 @@ lazy: true
371
391
```
372
392
373
393
Usage via the CLI
374
- ```
394
+
395
+ ``` bash
375
396
webpack-dev-server --lazy
376
397
```
377
398
@@ -390,6 +411,7 @@ With `noInfo` enabled, messages like the webpack bundle information that is show
390
411
noInfo: true
391
412
```
392
413
414
+
393
415
## ` devServer.open `
394
416
395
417
` boolean `
@@ -401,10 +423,12 @@ open: true
401
423
```
402
424
403
425
Usage via the CLI
404
- ```
426
+
427
+ ``` bash
405
428
webpack-dev-server --open
406
429
```
407
430
431
+
408
432
## ` devServer.openPage `
409
433
410
434
` string `
@@ -416,10 +440,12 @@ openPage: '/different/page'
416
440
```
417
441
418
442
Usage via the CLI
419
- ```
443
+
444
+ ``` bash
420
445
webpack-dev-server --open-page " /different/page"
421
446
```
422
447
448
+
423
449
## ` devServer.overlay `
424
450
425
451
` boolean ` ` object `
@@ -439,6 +465,7 @@ overlay: {
439
465
}
440
466
```
441
467
468
+
442
469
## ` devServer.pfx `
443
470
444
471
` string `
@@ -450,24 +477,29 @@ pfx: '/path/to/file.pfx'
450
477
```
451
478
452
479
Usage via the CLI
453
- ```
480
+
481
+ ``` bash
454
482
webpack-dev-server --pfx /path/to/file.pfx
455
483
```
456
484
485
+
457
486
## ` devServer.pfxPassphrase `
458
487
459
488
` string `
460
489
461
490
The passphrase to a SSL PFX file.
491
+
462
492
``` js
463
493
pfxPassphrase: ' passphrase'
464
494
```
465
495
466
496
Usage via the CLI
467
- ```
497
+
498
+ ``` bash
468
499
webpack-dev-server --pfx-passphrase passphrase
469
500
```
470
501
502
+
471
503
## ` devServer.port `
472
504
473
505
` number `
@@ -479,10 +511,12 @@ port: 8080
479
511
```
480
512
481
513
Usage via the CLI
482
- ```
514
+
515
+ ``` bash
483
516
webpack-dev-server --port 8080
484
517
```
485
518
519
+
486
520
## ` devServer.proxy `
487
521
488
522
` object `
@@ -549,7 +583,8 @@ proxy: {
549
583
` boolean `
550
584
551
585
Output running progress to console.
552
- ```
586
+
587
+ ``` bash
553
588
webpack-dev-server --progress
554
589
```
555
590
@@ -567,7 +602,8 @@ public: "myapp.test:80"
567
602
```
568
603
569
604
Usage via the CLI
570
- ```
605
+
606
+ ``` bash
571
607
webpack-dev-server --public myapp.test:80
572
608
```
573
609
@@ -612,10 +648,12 @@ quiet: true
612
648
```
613
649
614
650
Usage via the CLI
615
- ```
651
+
652
+ ``` bash
616
653
webpack-dev-server --quiet
617
654
```
618
655
656
+
619
657
## ` devServer.setup `
620
658
621
659
` function `
@@ -631,6 +669,7 @@ setup(app){
631
669
}
632
670
```
633
671
672
+
634
673
## ` devServer.socket `
635
674
636
675
` string `
@@ -642,7 +681,8 @@ socket: 'socket'
642
681
```
643
682
644
683
Usage via the CLI
645
- ```
684
+
685
+ ``` bash
646
686
webpack-dev-server --socket socket
647
687
```
648
688
@@ -676,16 +716,18 @@ For more information, see the [**stats documentation**](/configuration/stats).
676
716
677
717
T> This option has no effect when used with ` quiet ` or ` noInfo ` .
678
718
719
+
679
720
## ` devServer.stdin ` - CLI only
680
721
681
722
` boolean `
682
723
683
724
This option closes the server when stdin ends.
684
725
685
- ```
726
+ ``` bash
686
727
webpack-dev-server --stdin
687
728
```
688
729
730
+
689
731
## ` devServer.useLocalIp `
690
732
691
733
` boolean `
@@ -697,10 +739,12 @@ useLocalIp: true
697
739
```
698
740
699
741
Usage via the CLI
700
- ```
742
+
743
+ ``` bash
701
744
webpack-dev-server --useLocalIp
702
745
```
703
746
747
+
704
748
## ` devServer.watchContentBase `
705
749
706
750
` boolean `
@@ -714,10 +758,12 @@ watchContentBase: true
714
758
It is disabled by default.
715
759
716
760
Usage via the CLI
717
- ```
761
+
762
+ ``` bash
718
763
webpack-dev-server --watch-content-base
719
764
```
720
765
766
+
721
767
## ` devServer.watchOptions ` 🔑
722
768
723
769
` object `
0 commit comments