From 312ae4e3026b00ed2842d00d98dbd0257aede6ca Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Wed, 27 Oct 2021 18:29:01 -0700 Subject: [PATCH 1/2] docs(configuration): add `client.reconnect` --- src/content/configuration/dev-server.mdx | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/content/configuration/dev-server.mdx b/src/content/configuration/dev-server.mdx index 84cee17627f4..40a1e9822d2a 100644 --- a/src/content/configuration/dev-server.mdx +++ b/src/content/configuration/dev-server.mdx @@ -332,6 +332,69 @@ To disable: npx webpack serve --no-client-progress ``` +### reconnect + +`boolean = true` `number` + +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` From 7790dcacd39f39ce990244a66b4d479b24dbe2f2 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Wed, 27 Oct 2021 18:33:51 -0700 Subject: [PATCH 2/2] docs: mention version --- src/content/configuration/dev-server.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/configuration/dev-server.mdx b/src/content/configuration/dev-server.mdx index 40a1e9822d2a..bb98b705fbda 100644 --- a/src/content/configuration/dev-server.mdx +++ b/src/content/configuration/dev-server.mdx @@ -336,6 +336,8 @@ npx webpack serve --no-client-progress `boolean = true` `number` + + 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**