How to auto refresh the page when code changed

Like using the webpack-dev-server the hot reload mode. How can I get my browser auto-reload the page when changing my code? if I need to modify the webpack configuration file by my self?

[original thread by OliverYoung]

[John Kapolos]

Hot reloading happens by a side-channel, which uses a different port. So you need to expose the live-reload port on the docker run command, like this -p 35729:35729

[OliverYoung]

Hi… Thank you for your reply. I am trying to use the yeoman generator to create a theia extension. I find I need to start a backend express server before watch my extension. The static file packed by webpack will host on this server. Does it mean if I want to turn on hot-reload I should modify the server.js file and import the webpack-hot-middleware and add hot reloading into this existing server?

We tried to use hot reload at the beginning but it was not very useful with Theia since most of content is dynamic and setup was not easy. Not sure whether it is possible to setup now.

There is webpack.config.js in your example app which can be modified to customize bundling, you can try to enable hot reload there.