- It works without touching laravel-elixir source files, so it will not break on updates.
- It runs only on watch task, so that when you run other tasks, livereload will not start and hang the console.
- It performs soft-reloads on CSS changes, instead of a full page reload.
npm install gulp-livereload
if you still don't have it.- Create an elixir.json file on the root of your project (where your gulpfile.js is located)
- Update your gulpfile.js with the related code.
- Run it with
gulp watch
.
- Watch only /public folder for CSS changes, or otherwise it will trigger a full page reload (because of .map files)
- Your watcher name on elixir.json must match a gulp task that will notify LiveReload.
- You can watch
"app/**/*.php"
too if you want.
I ended up with the following which worked for me.