Increase gulp.watch() interval to decrease CPU usage

This brings idle CPU usage down to 1.5% from 14% for me.
This commit is contained in:
Dan Stillman 2017-05-24 17:59:17 -04:00
parent 8bc76dd2db
commit 8f116f60c4

View file

@ -132,13 +132,15 @@ gulp.task('sass', () => {
gulp.task('build', ['js', 'sass', 'symlink']);
gulp.task('dev', ['clean'], () => {
let watcher = gulp.watch(jsGlob);
var interval = 750;
let watcher = gulp.watch(jsGlob, { interval });
watcher.on('change', function(event) {
getJS(event.path);
});
gulp.watch('src/styles/*.scss', ['sass']);
gulp.watch('src/styles/*.scss', { interval }, ['sass']);
gulp.start('build');
});