jdan / cleaver

30-second slideshows for hackers
http://jdan.github.io/cleaver
MIT License
4.02k stars 305 forks source link

Enable live reload when using cleaver watch #144

Closed guifromrio closed 8 years ago

guifromrio commented 8 years ago

This implements Live Reload using https://github.com/mklabs/tiny-lr.

The fallback to replaceState was introduced because in Chrome>45 replaceState is not allowed in the file:// protocol. Discussion: https://code.google.com/p/chromium/issues/detail?id=529313

The live reload script is only introduced in watch mode.

When exiting with SIGINT (CTRL+C), a last rebuild will be issued without the live reload script.

PS: Thanks for the excellent framework. :) The code is very good, it was a breeze to contribute to. :+1:

jdan commented 8 years ago

Hey @firstdoit, this is super awesome! I had no idea live-reloading was so easy.

I went ahead and added you as a collaborator to cleaver, since I no longer actively work on it. No pressure or anything, but I'll let you merge your own PR here. Everything looks good to me, just a couple of inline comments.

Thanks again! :star2:

guifromrio commented 8 years ago

Thanks! Solved all the issues you found.

jdan commented 8 years ago

@firstdoit Woot!

I think I can add you to npm as well if you wanted to cut a new release. I'll look into that later today.