From cea6b6c8377df7f1a7b84be72f351b3420a12d1f Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Mon, 1 Apr 2019 18:59:48 +0800 Subject: [PATCH] Improved grunt express/casper watchers closes #9718 - fs.fileWatch that is used internally by 'gase' in 'grunt-contrib-watch', is having 100ms pooling default (https://github.com/shama/gaze/blob/07828a684566b6d4844f12b747e74e376fa31744/lib/gaze.js#L36). This is causing hight CPU usage for large amount of files. - As suggested in https://github.com/gruntjs/grunt-contrib-watch#why-is-the-watch-devouring-all-my-memorycpu the watch interval was set to higher 500ms because the recommended default of 5s (https://github.com/gruntjs/grunt-contrib-watch/issues/145#issuecomment-20526067) was visible in the development flow --- Gruntfile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 911dae6347..ef815c66fa 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -70,7 +70,8 @@ const configureGrunt = function (grunt) { 'content/themes/casper/assets/js/*.js' ], options: { - livereload: true + livereload: true, + interval: 500 } }, express: { @@ -84,7 +85,8 @@ const configureGrunt = function (grunt) { tasks: ['express:dev'], options: { spawn: false, - livereload: true + livereload: true, + interval: 500 } } },