Skip to content

docs(configuration): add client.reconnect #5637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions src/content/configuration/dev-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,71 @@ To disable:
npx webpack serve --no-client-progress
```

### reconnect

`boolean = true` `number`

<Badge text="v4.4.0+" />

Tells dev-server the number of times it should try to reconnect the client. When `true` it will try to reconnect unlimited times.

**webpack.config.js**

```javascript
module.exports = {
//...
devServer: {
client: {
reconnect: true,
},
},
};
```

Usage via the CLI:

```bash
npx webpack serve --client-reconnect
```

When set to `false` it will not try to reconnect.

```javascript
module.exports = {
//...
devServer: {
client: {
reconnect: false,
},
},
};
```

Usage via the CLI:

```bash
npx webpack serve --no-client-reconnect
```

You can also specify the exact number of times the client should try to reconnect.

```javascript
module.exports = {
//...
devServer: {
client: {
reconnect: 5,
},
},
};
```

Usage via the CLI:

```bash
npx webpack serve --client-reconnect 5
```

### webSocketTransport

`'ws' | 'sockjs'` `string`
Expand Down