High CPU usage with grunt 1.0.3 and sailsjs

598 views Asked by At

Here's my watch.js file :

module.exports = function (grunt) {

grunt.config.set('watch', {
assets: {

  // Assets to watch:
  files: [
    'assets/**/*',
    'tasks/pipeline.js',
    '!**/node_modules/**',
    '!assets/images/**' // <- Added this line to stop watching
  ],

  // When assets are changed:
  tasks: [
    'syncAssets',
    'linkAssets'
  ]
}
});

I followed this to reduce the folder grunt watches for change but to no avail. Also, I deleted the task folder along with Gruntfile.js file to stop using grunt but doing htop on the server still shows grunt hogging the cpu.

1

There are 1 answers

0
Adrij Shikhar On

Add this in the watch script options : { interval: 1000 } in Gruntfile.js