From 8f116f60c45dafd6ace14659828f78002f3f2bce Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 24 May 2017 17:59:17 -0400 Subject: [PATCH] Increase gulp.watch() interval to decrease CPU usage This brings idle CPU usage down to 1.5% from 14% for me. --- gulpfile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7668f623b..84000e492 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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'); });