Skip to content
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

Delay option for server refresh #110

Open
csakis opened this issue Sep 3, 2016 · 3 comments
Open

Delay option for server refresh #110

csakis opened this issue Sep 3, 2016 · 3 comments

Comments

@csakis
Copy link

csakis commented Sep 3, 2016

I am using a custom webserver for webpack, Whenever I modify my source files, my IDE needs 2-3 seconds to build the project and put it on the server.
I would like to have an option {delay: 3000 } in tiny-lr so that my browser can refresh after a given amount of time.

@mklabs
Copy link
Owner

mklabs commented Sep 5, 2016

Hi @csakis

Is it something that can be done with the watcher ? I don't know if you use gulp or something else, but you might add a setTimeout(reload, 3000) or something similar ?

@csakis
Copy link
Author

csakis commented Sep 6, 2016

I use webpack and there is a plugin called webpack-livereload-plugin that uses tiny-lr. If I watch my source files being changed and initiate a browser refresh, then the browser will be refreshed too soon. It would be nice to delay the websocket message by an arbitrary number of milliseconds, so my webserver has enough time to refresh the files on the server, then the browser could refresh.

@mklabs
Copy link
Owner

mklabs commented Sep 7, 2016

I think this is the responsibility of webpack-livereload-plugin or more generally the build system that uses tiny-lr, what triggers the change request or event. I'm not very willing to add a option to delay message to tiny-lr itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants