-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce CLI option "debounce" #168
Comments
The idea sounds good to me, I don't like the name |
Wait is not enough. Lets say you have 30 changes every 50ms and you wait 500ms. So 3 builds? |
Any chance this can be merged? I also am in this situation and it is really annoying to see the browser reload 10 times (one per html template compiled) |
This is an issue, PRs welcome |
Ahh sorry I thought the @mojoaxel solution (mojoaxel@e7b2f80) was complete and only neede to be merged |
Anyway as future reference to anyone having the same issue, until this issue is solved, a workaround could be to only watch a particular file and touch it every time the build process is complete. An example of my package.json:
So basically the the watch-html and watch-css watch for changes on the sources, changes them all and at the end only reload once touching the reload/reload.now file that is the file I'm watching at in reload-browser. Hope this helps |
If reload is used with the
--watch-dir
option the browser gets reload instantly after a file-change occurs. This file-change might be triggered e.g. by a build tool, that empties the watched folder to refill it moments later with a new version of the app or web page. In this case the browser may reload the web page in an unready state which can cause errors in the browser.To solve this problem I propose a new optional parameter
--debounce wait
which will postpone the reload until afterwait
milliseconds have elapsed since the last time a file-change occurred. This value could be st internally to 0 which would trigger a reload instantly on every change.Opinions on this?
The text was updated successfully, but these errors were encountered: