Skip to content

Commit

Permalink
Improved grunt express/casper watchers
Browse files Browse the repository at this point in the history
closes TryGhost#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 (gruntjs/grunt-contrib-watch#145 (comment)) was visible in the development flow
  • Loading branch information
naz committed Apr 2, 2019
1 parent 7d6436f commit cea6b6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const configureGrunt = function (grunt) {
'content/themes/casper/assets/js/*.js'
],
options: {
livereload: true
livereload: true,
interval: 500
}
},
express: {
Expand All @@ -84,7 +85,8 @@ const configureGrunt = function (grunt) {
tasks: ['express:dev'],
options: {
spawn: false,
livereload: true
livereload: true,
interval: 500
}
}
},
Expand Down

0 comments on commit cea6b6c

Please sign in to comment.