Laravel 5 Elixir Gulp LiveReload

If you are anything like me, you are having trouble getting LiveReload to work in the Elixir overlay for Gulp. Good news is, I’ve finally got it figured out and am here to share. It turns out to be really simple, you just need to create an extension for Elixir. Add this to your gulpfile.js:

Then in your HTML, include this line:

One thing you will notice is in the livereload.changed()  method, I’m passing the word localhost. If you do not pass something there (for whatever reason), you will get an error like this:

It seems to work fine with an asterisk passed there as well. Maybe somebody can comment further what should go there.

One thought on “Laravel 5 Elixir Gulp LiveReload

  1. Hey,

    I struggled with this for months, eventually arriving to this solution in one of my projects.

    However, I personally still found Elixir to be incredibly slow, especially the bigger and more complex my front-end system became. So because of this, I wound up waiting 3 to 5 seconds before the livereload was triggered… :-/

    Because of this, I made Fannypack (https://github.com/lukeed/fannypack), an alternative to Elixir. It’s incredibly quick and, as an added bonus, has browser sync built in!
    It’s literally brand spankin’ new, so it doesn’t have **all** the functionality that Elixir community’s provided, but if you check it out, I’d be happy to fill in any missing tasks.

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *