Open MartinManev opened 3 years ago
The use case is discussed at https://github.com/vuejs/vue-cli/issues/1472#issuecomment-394755323 and https://github.com/vuejs/vue-cli/commit/da38ed4a2724336bfefa0c6c624a9a5c1765a1d2#commitcomment-31564562
Does it break your app or just bring annoyance?
It's not breaking. But in specific cases HMR won't work out of the box and needs extra setup to make it work.
Version
4.5.13
Environment info
Steps to reproduce
Create a new project with vue ui.
$npm run serve
App running at:
What is expected?
If visiting http://localhost:8080, then HMR requests should be directed to localhost:8080.
If visiting http://192.168.x.x, then HMR requests should be directed to 192.168.x.x:8080.
If I have a proxy and visiting http://my.domain.com, then HMR requests should be directed to my.domain.com.
What is actually happening?
HMR requests are always directed to 192.168.x.x:8080, regardless of current host.
See screenshots.
I know it is possible to configure the webpack dev server to use a specific host and port, but I don't see why it shouldn't be dynamic. Especially when using --host 0.0.0.0.
I hope I'm not missing anything obvious.