From 68930aaa5d0654e543a81a26ab0549524982ee74 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 24 Feb 2015 16:36:13 -0500 Subject: [PATCH] limit watch paths to three levels deep in nodebb-*, should be enough hopefully minimatch sucks, unless I'm using it wrong. negating = find everything then remove as necessary => long load times before watch is activated --- Gruntfile.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 54e722530b..70acfe7a3f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,11 @@ +"use strict"; + +var fork = require('child_process').fork, + env = process.env, + worker; + +process.env.NODE_ENV = 'development'; + module.exports = function(grunt) { grunt.initConfig({ less: { @@ -9,35 +17,28 @@ module.exports = function(grunt) { }, watch: { lessUpdated: { - files: ['public/**/*.less', 'node_modules/nodebb-*/**/*.less'] + files: ['public/**/*.less', 'node_modules/nodebb-*/*.less', 'node_modules/nodebb-*/*/*.less', 'node_modules/nodebb-*/*/*/*.less', 'node_modules/nodebb-*/*/*/*/*.less'] }, clientUpdated: { - files: ['public/src/**/*.js', 'node_modules/nodebb-*/**/*.js'] + files: ['public/src/**/*.js', 'node_modules/nodebb-*/*.js', 'node_modules/nodebb-*/*/*.js', 'node_modules/nodebb-*/*/*/*.js', 'node_modules/nodebb-*/*/*/*/*.js'] }, serverUpdated: { files: ['*.js', 'src/**/*.js'] }, templatesUpdated: { - files: ['src/views/**/*.tpl', 'node_modules/nodebb-*/**/*.tpl'] + files: ['src/views/**/*.tpl', 'node_modules/nodebb-*/*.tpl', 'node_modules/nodebb-*/*/*.tpl', 'node_modules/nodebb-*/*/*/*.tpl', 'node_modules/nodebb-*/*/*/*/*.tpl'] } } }); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.registerTask('default', ['watch']); - var fork = require('child_process').fork, - env = process.env; - - process.env.NODE_ENV = 'development' - - var worker = fork('app.js', ['--log-level=info'], { + worker = fork('app.js', [], { env: env, silent: false }); - grunt.event.on('watch', function(action, filepath, target) { var args = []; @@ -59,5 +60,4 @@ module.exports = function(grunt) { silent: false }); }); - }; \ No newline at end of file