Skip to content

Instantly share code, notes, and snippets.

@fabioam
Last active Jan 28, 2018
Embed
What would you like to do?
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