Skip to content

Instantly share code, notes, and snippets.

@mkoller
Created August 16, 2016 14:43
Show Gist options
  • Save mkoller/7ba4b452033325ae05eb46041cdac6e9 to your computer and use it in GitHub Desktop.
Save mkoller/7ba4b452033325ae05eb46041cdac6e9 to your computer and use it in GitHub Desktop.
// Gulp watch syntax
gulp.task('watch', ['browserSync' , 'sass'], function(){
gulp.watch('scss/**/*.scss', ['sass']); // globs .scss files for watching
// Reloads the browser whenever HTML or JS files change
gulp.watch('*.html', browserSync.reload); // watches all .html files found in the root dir
gulp.watch('js/**/*.js', browserSync.reload); // globs .js files for watching
console.log('To stop watching type control c'); // this will log a console message that instructs how to stop th gulp task
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment