Webpack Dev Server defaults to using localhost as its host. This can easily be overwritten by specifying the host parameter with either a hostname or IP address. However, it seems that you can only specify one. For example, if I specify the IP Address 192.168.1.20, then it stops responding to localhost. How can I configure Webpack Dev Server to listen to multiple hosts?
-
You were able to find it?phkavitha– phkavitha2016-03-02 20:43:35 +00:00Commented Mar 2, 2016 at 20:43
-
@phkavitha: I started a discussion here: github.com/webpack/webpack-dev-server/issues/400. If you can chime in with your feedback, that will be really helpful.Johnny Oshika– Johnny Oshika2016-03-09 02:53:37 +00:00Commented Mar 9, 2016 at 2:53
Add a comment
|
1 Answer
0.0.0.0 is the catch-all host and will bind to all hosts.
Example:
devServer: {
port: 3000,
host: '0.0.0.0'
}
Source: https://github.com/webpack/webpack-dev-server/issues/400#issuecomment-201213206