Live reload feature
Tazeg opened this issue · 5 comments
Is there a way to watch the path and to reload the web page when a file is changed ?
This would be great as a dev web server.
When for example the bundle.js is changed, the web page should reload.
Thanks.
@Tazeg it should be already working in that way by design, are you sure if it's not working? browser refresh will reflect the new changes.
Yes, refreshing the browser manually renders the new files.
But I would like an automatic reload when a modification occurs on a file in the path.
For example. I have index.html. I start the server : simplehttpserver. I open index.html with my editor. I save the file. Then here, the browser should reload the page automatically. This is not the case actually.
If it can help, I know that hugo or JS bundlers inject a script code for this. But I don't know exactly how this hack works.
I found the term : HMR (Hot Module Reload). Usefull for developpers. But it may be out of the scope of simplehttpserver.
Closing as this will be handled in the linked issue.