From 3ec62499f5729b274fb5e9d2814a9c8d818bfc3c Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 9 Jul 2018 10:12:33 +0100 Subject: [PATCH] Added `--no-server-watch` option to `grunt-dev` (#9719) refs https://github.com/TryGhost/Ghost/issues/9718 - running `grunt dev --no-server-watch` will skip watching server and theme files - reduces idle CPU usage from 20% to 0% - useful for client-only development to save battery power --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index afe2608fb1..32699c07e7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -65,7 +65,7 @@ var config = require('./core/server/config'), // ### grunt-contrib-watch // Watch files and livereload in the browser during development. // See the [grunt dev](#live%20reload) task for how this is used. - watch: { + watch: grunt.option('no-server-watch') ? {files: []} : { livereload: { files: [ 'content/themes/casper/assets/css/*.css', @@ -79,7 +79,7 @@ var config = require('./core/server/config'), files: ['core/ghost-server.js', 'core/server/**/*.js', 'config.*.json', '!config.testing.json'], tasks: ['express:dev'], options: { - nospawn: true, + spawn: false, livereload: true } }