Skip to content

Commit

Permalink
Increase gulp.watch() interval to decrease CPU usage
Browse files Browse the repository at this point in the history
This brings idle CPU usage down to 1.5% from 14% for me.
  • Loading branch information
dstillman committed May 24, 2017
1 parent 8bc76dd commit 8f116f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gulpfile.js
Expand Up @@ -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');
});

Expand Down

0 comments on commit 8f116f6

Please sign in to comment.