Skip to content

Commit 735ed82

Browse files
authored
docs(configuration): update devServer.headers (#5598)
* docs(configuration): update `devServer.headers` * docs(configuration): update `devServer.headers`
1 parent dcf403d commit 735ed82

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/content/configuration/dev-server.mdx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ W> Don't specify `https.ca` and `https.cacert` options together, if specified `h
635635

636636
## devServer.headers
637637

638-
`function` `object`
638+
`array` `function` `object`
639639

640640
Adds headers to all responses:
641641

@@ -652,6 +652,28 @@ module.exports = {
652652
};
653653
```
654654

655+
You can also pass an array:
656+
657+
**webpack.config.js**
658+
659+
```javascript
660+
module.exports = {
661+
//...
662+
devServer: {
663+
headers: [
664+
{
665+
key: 'X-Custom',
666+
value: 'foo',
667+
},
668+
{
669+
key: 'Y-Custom',
670+
value: 'bar',
671+
},
672+
],
673+
},
674+
};
675+
```
676+
655677
You can also pass a function:
656678

657679
```javascript

0 commit comments

Comments
 (0)