Skip to content

Commit b7af6a2

Browse files
authored
docs(configuration): add client.reconnect (#5637)
* docs(configuration): add `client.reconnect` * docs: mention version
1 parent 57bbd9c commit b7af6a2

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

src/content/configuration/dev-server.mdx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,71 @@ To disable:
332332
npx webpack serve --no-client-progress
333333
```
334334

335+
### reconnect
336+
337+
`boolean = true` `number`
338+
339+
<Badge text="v4.4.0+" />
340+
341+
Tells dev-server the number of times it should try to reconnect the client. When `true` it will try to reconnect unlimited times.
342+
343+
**webpack.config.js**
344+
345+
```javascript
346+
module.exports = {
347+
//...
348+
devServer: {
349+
client: {
350+
reconnect: true,
351+
},
352+
},
353+
};
354+
```
355+
356+
Usage via the CLI:
357+
358+
```bash
359+
npx webpack serve --client-reconnect
360+
```
361+
362+
When set to `false` it will not try to reconnect.
363+
364+
```javascript
365+
module.exports = {
366+
//...
367+
devServer: {
368+
client: {
369+
reconnect: false,
370+
},
371+
},
372+
};
373+
```
374+
375+
Usage via the CLI:
376+
377+
```bash
378+
npx webpack serve --no-client-reconnect
379+
```
380+
381+
You can also specify the exact number of times the client should try to reconnect.
382+
383+
```javascript
384+
module.exports = {
385+
//...
386+
devServer: {
387+
client: {
388+
reconnect: 5,
389+
},
390+
},
391+
};
392+
```
393+
394+
Usage via the CLI:
395+
396+
```bash
397+
npx webpack serve --client-reconnect 5
398+
```
399+
335400
### webSocketTransport
336401

337402
`'ws' | 'sockjs'` `string`

0 commit comments

Comments
 (0)