Skip to content

Instantly share code, notes, and snippets.

@almone
Created August 5, 2016 12:33
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 almone/efe79a367b4ded3f350f8c4c70011a89 to your computer and use it in GitHub Desktop.
Save almone/efe79a367b4ded3f350f8c4c70011a89 to your computer and use it in GitHub Desktop.
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