You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Activity
ehsandeep commentedon Apr 28, 2021
@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.
Tazeg commentedon Apr 28, 2021
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 openindex.htmlwith 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
hugoor JS bundlers inject a script code for this. But I don't know exactly how this hack works.Tazeg commentedon Apr 29, 2021
I found the term : HMR (Hot Module Reload). Usefull for developpers. But it may be out of the scope of simplehttpserver.
Mzack9999 commentedon Jun 27, 2021
@Tazeg this should be possible when #41 will be implemented via header/meta/javascript injection
ehsandeep commentedon Jul 28, 2021
Closing as this will be handled in the linked issue.