Created
August 5, 2016 12:33
-
-
Save almone/efe79a367b4ded3f350f8c4c70011a89 to your computer and use it in GitHub Desktop.
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
var gulp = require('gulp'); | |
var bs = require('browser-sync').create(); | |
var reload = bs.reload; | |
// watch files for changes and reload | |
gulp.task('watch', function(gulpCallback) { | |
// bs.init | |
bs.init({ | |
proxy: "example.dev" | |
}); | |
// watch php and reload browsers when it changes | |
gulp.watch('**/*.php', reload); | |
// grab css files and send them into bs.stream | |
gulp.watch('**/*.css', function() { | |
// this injects the css into the page | |
gulp.src('**/*.css') | |
.pipe(bs.stream()); | |
}); | |
// notify gulp that this task is done | |
gulpCallback(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment