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
v1.18.x
psychobunny 10 years ago
parent 8862fcba33
commit 68930aaa5d

@ -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) { module.exports = function(grunt) {
grunt.initConfig({ grunt.initConfig({
less: { less: {
@ -9,35 +17,28 @@ module.exports = function(grunt) {
}, },
watch: { watch: {
lessUpdated: { 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: { 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: { serverUpdated: {
files: ['*.js', 'src/**/*.js'] files: ['*.js', 'src/**/*.js']
}, },
templatesUpdated: { 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.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']); grunt.registerTask('default', ['watch']);
var fork = require('child_process').fork, worker = fork('app.js', [], {
env = process.env;
process.env.NODE_ENV = 'development'
var worker = fork('app.js', ['--log-level=info'], {
env: env, env: env,
silent: false silent: false
}); });
grunt.event.on('watch', function(action, filepath, target) { grunt.event.on('watch', function(action, filepath, target) {
var args = []; var args = [];
@ -59,5 +60,4 @@ module.exports = function(grunt) {
silent: false silent: false
}); });
}); });
}; };
Loading…
Cancel
Save