I am trying to run webpack-dev-server within docker so I can hot-reload my react components. For some reason, webpack-dev-server does not hot re-load through docker though. Changes to the react files does recompile code, according to the logs. But my webbrowser is not receiving the signal telling it to refresh. If I manually refresh the browser, it does reflect the code changes though.
Interestingly, this same config actually works when I run it natively on the host machine, so I suspect it's a socket connection issue at this point.
How does webpack-dev-server let the web browser know that it should re-load?
I also notice webpack-dev-server opens port 8080. What is the purpose of this? Do I give the (http://localhost:8080/) address to my web browser instead of my usual webserver address (http://localhost:3000/)? Or is port 8080 used for something else?
Here is my config file for reference:
dev_server:
https: false
host: localhost
port: 8080
public: localhost:8080
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
pretty: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
-p 8081:8080
for example, and connect it through localhost:8081? – Alejandro Galera