Skip to content

Commit 5f2a01b

Browse files
authored
docs(configuration): add allowedHosts: 'auto' (#5343)
1 parent da57cca commit 5f2a01b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/content/configuration/dev-server.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,25 @@ Usage via the CLI:
146146
npx webpack serve --allowed-hosts all
147147
```
148148

149+
When set to `'auto'` this option always allows `localhost`, [`host`](#devserverhost), and [`client.webSocketURL.hostname`](#websocketurl):
150+
151+
**webpack.config.js**
152+
153+
```javascript
154+
module.exports = {
155+
//...
156+
devServer: {
157+
allowedHosts: 'auto',
158+
},
159+
};
160+
```
161+
162+
Usage via the CLI:
163+
164+
```bash
165+
npx webpack serve --allowed-hosts auto
166+
```
167+
149168
## `devServer.bonjour`
150169

151170
`boolean` `object`

0 commit comments

Comments
 (0)