Lego2012
10/11/2016 - 8:07 PM

From http://stackoverflow.com/questions/35808240/gulp-jekyll-browser-sync-rebuild-loop

// Working on this question has led to this - I think this will be my new watch (I have no reason not to watch all files, other may not want this):

gulp.watch(['**/*.*', '!_site/**/*', '!node_modules/**/*','!.sass-cache/**/*' ], ['jekyll-rebuild']);

// the first part seems to watch everything, the second part excludes the site folder and everything in it, then the same for node_modules and .sass-cache.. So far I have not been able to break it, and this is much simpler than what I had:

gulp.watch(['./*', '_layouts/*', '_videos/*', 'order-online/*', '_includes/*', '_posts/*', '_sass/*', 'css/*', 'services/*', '_data/*' ], ['jekyll-rebuild']);