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
I was trying to use it to live-reload my static site which is generated by a Python script. To keep things simple, my script just deletes the entire build folder and then fills it with the generated HTML. I ran into two problems:
Originally, my script just deletes the _build folder and then recreates it. However, then the live-reload doesn't work, presumably because the watcher is still watching the old deleted folder, and doesn't track the newly created folder.
I changed my script to just delete all of the contents of _build but not the folder itself, and then fill it with content. However, if (and when) live-server tries to reload the page I'm currently on after it has been deleted, but before it has been generated, it reloads to a blank page, and can't auto-reload to the generated page after that.
Would it be possible to make live-reload such that it works with the deleted and re-created folder, and/or so that it doesn't try to reload if the currently open html file does not exist?
For reference, here's a quick script that works like the first version:
Hi, @mgunyho, I just fixed the second problem in #45. But as for the first problem, it's relative to the upstream crate notify:
On some platforms, if the path is renamed or removed while being watched, behaviour may be unexpected. See discussions in #165 and #166. If less surprising behaviour is wanted one may non-recursively watch the parent directory as well and manage related events.
So you can just delete all of the contents of _build but not the folder itself, like what you just mentioned.
Hi! Thanks for this tool.
I was trying to use it to live-reload my static site which is generated by a Python script. To keep things simple, my script just deletes the entire build folder and then fills it with the generated HTML. I ran into two problems:
_build
folder and then recreates it. However, then the live-reload doesn't work, presumably because the watcher is still watching the old deleted folder, and doesn't track the newly created folder._build
but not the folder itself, and then fill it with content. However, if (and when) live-server tries to reload the page I'm currently on after it has been deleted, but before it has been generated, it reloads to a blank page, and can't auto-reload to the generated page after that.Would it be possible to make live-reload such that it works with the deleted and re-created folder, and/or so that it doesn't try to reload if the currently open html file does not exist?
For reference, here's a quick script that works like the first version:
And here's one that works like the second version:
The text was updated successfully, but these errors were encountered: