Skip to content

Commit 8464279

Browse files
authored
docs(configuration): update devServer.https (#5643)
1 parent 7c70871 commit 8464279

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/configuration/dev-server.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ npx webpack serve --http2 --https-key ./path/to/server.key --https-cert ./path/t
629629

630630
`boolean` `object`
631631

632-
By default, dev-server will be served over `HTTP`. It can optionally be served over `HTTP/2` with `HTTPS`:
632+
By default, dev-server will be served over `HTTP`. It can optionally be served over `HTTPS`:
633633

634634
**webpack.config.js**
635635

@@ -662,10 +662,10 @@ With the above setting, a self-signed certificate is used, but you can provide y
662662
module.exports = {
663663
devServer: {
664664
https: {
665-
ca: './server.pem',
666-
pfx: './server.pfx',
667-
key: './server.key',
668-
cert: './server.crt',
665+
ca: './path/to/server.pem',
666+
pfx: './path/to/server.pfx',
667+
key: './path/to/server.key',
668+
cert: './path/to/server.crt',
669669
passphrase: 'webpack-dev-server',
670670
requestCert: true,
671671
},
@@ -678,7 +678,7 @@ This object is passed straight to the Node.js HTTPS module, so see the [HTTPS do
678678
To pass your own certificate via the CLI use the following options:
679679

680680
```bash
681-
npx webpack serve --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-ca ./path/to/ca.pem
681+
npx webpack serve --https-request-cert --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-ca ./path/to/ca.pem --https-pfx ./path/to/server.pfx --https-passphrase webpack-dev-server
682682
```
683683

684684
`webpack-dev-server >= v4.2.0` allows you to set additional [TLS options](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) like `minVersion`. Also, you can directly pass the contents of respective files:

0 commit comments

Comments
 (0)