7

It looks like gulp-livereload requires Chrome's livereload plugin to work.

Is there a way to implement livereload that doesn't require any browser plugin, and will work in all browsers?

Any examples will be appreciated.

Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746

1 Answers1

13

How I've missed that.

You should add the livereload script in your index.html, and change the port to which you're currently using.

<script src="http://localhost:35729/livereload.js?snipver=1"></script>

You may want to inject this only on a development version, so I think you should have a look to gulp-inject to get this behaviour.

Preview
  • 35,317
  • 10
  • 92
  • 112
  • Thanks! Adding this script solved the problem. Could you just clarify where `livereload.js` is coming from? Is it available at `localhost:35729` because of `livereload.listen()` in the `gulpfile.js`? Also, what `snipver=1` does? (the docs are not clear) – Misha Moroshko Sep 27 '14 at 11:35
  • Indeed this script is available through the `gulp-livereload` plugin, for the `snipver`, you should have a look to [this link](https://github.com/livereload/livereload-js), which explain it well – Preview Sep 27 '14 at 11:39