v1.18.x
psychobunny 9 years ago
parent d24b15a584
commit 6e617dd69a

@ -7,16 +7,17 @@ var fork = require('child_process').fork,
module.exports = function(grunt) {
var args = [];
if (!grunt.option('verbose')) {
args.push('--log-level=info');
}
function update(action, filepath, target) {
var args = [],
var updateArgs = args,
fromFile = '',
compiling = '',
time = Date.now();
if (!grunt.option('verbose')) {
args.push('--log-level=info');
}
if (target === 'lessUpdated_Client') {
fromFile = ['js', 'tpl', 'acpLess'];
compiling = 'clientLess';
@ -37,11 +38,11 @@ module.exports = function(grunt) {
return incomplete.indexOf(ext) === -1;
});
args.push('--from-file=' + fromFile.join(','));
updateArgs.push('--from-file=' + fromFile.join(','));
incomplete.push(compiling);
worker.kill();
worker = fork('app.js', args, { env: env });
worker = fork('app.js', updateArgs, { env: env });
worker.on('message', function() {
if (incomplete.length) {
@ -101,6 +102,6 @@ module.exports = function(grunt) {
env.NODE_ENV = 'development';
worker = fork('app.js', [], { env: env });
worker = fork('app.js', args, { env: env });
grunt.event.on('watch', update);
};
Loading…
Cancel
Save