Skip to content

Instantly share code, notes, and snippets.

@fabioam
Last active January 28, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabioam/62ceaa4ad3017b8b54e9e26fb196d8d4 to your computer and use it in GitHub Desktop.
Save fabioam/62ceaa4ad3017b8b54e9e26fb196d8d4 to your computer and use it in GitHub Desktop.
Simple gulp file example using gulp-livereload
/*
* Simple gulp file using gulp-livereload
* $ gulp -v
* CLI version 3.9.1
* Local version 3.9.1
*
* run example:
* $ gulp watch
*
* if you have errors, check first if you have fs.inotify.max_user_watches configured appropriate
* for Arch Linux follow these steps:
* # echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.d/99-sysctl.conf
* # sysctl --system
* this will also persist after reboot
*/
var gulp = require('gulp'),
livereload = require('gulp-livereload');
var fileArray = [
'dir1/*.php',
'dir2/**/*.php',
];
gulp.task('php', function () {
gulp.src(fileArray).pipe(livereload({ start: true }));
});
gulp.task('watch', function(){
livereload.listen();
gulp.watch(fileArray,['php']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment