Last active
January 28, 2018 14:39
-
-
Save fabioam/62ceaa4ad3017b8b54e9e26fb196d8d4 to your computer and use it in GitHub Desktop.
Simple gulp file example using gulp-livereload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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