Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gulp.task('watch', ['browser-sync', 'serve'], function () {
var browserSync = require('browser-sync');
// watch for changes
gulp.watch([
"app/*.html",
"app/styles/**/*.css",
"app/scripts/**/*.js",
"app/images/**/*"
]).on('change', function () {
browserSync.reload({stream:true});
});
gulp.watch('app/styles/**/*.scss', ['styles']);
gulp.watch('app/scripts/**/*.js', ['scripts']);
gulp.watch('app/images/**/*', ['images']);
gulp.watch('bower.json', ['wiredep']);
});
@shakyShane

This comment has been minimized.

Copy link

commented Apr 23, 2014

  1. Upgrade to BrowserSync 0.8.2
  2. move var browserSync = require('browser-sync'); at the top of your gulpfile
  3. replace browserSync.reload({stream:true}); with just browserSync.reload();
  4. don't watch css files with gulp, put .pipe(browserSync.reload({stream:true})) in your sass task.
@niallobrien

This comment has been minimized.

Copy link
Owner Author

commented Apr 23, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.