diff --git a/src/content/configuration/dev-server.mdx b/src/content/configuration/dev-server.mdx index 6be31a202d41..fe23b5b4f36a 100644 --- a/src/content/configuration/dev-server.mdx +++ b/src/content/configuration/dev-server.mdx @@ -635,7 +635,7 @@ W> Don't specify `https.ca` and `https.cacert` options together, if specified `h ## devServer.headers -`function` `object` +`array` `function` `object` Adds headers to all responses: @@ -652,6 +652,28 @@ module.exports = { }; ``` +You can also pass an array: + +**webpack.config.js** + +```javascript +module.exports = { + //... + devServer: { + headers: [ + { + key: 'X-Custom', + value: 'foo', + }, + { + key: 'Y-Custom', + value: 'bar', + }, + ], + }, +}; +``` + You can also pass a function: ```javascript