optimizing process.send for js minification

v1.18.x
psychobunny 9 years ago
parent acd24d856f
commit e2bc5f241a

@ -122,15 +122,11 @@ Loader.addWorkerEvents = function(worker) {
Loader.reload(); Loader.reload();
break; break;
case 'js-propagate': case 'js-propagate':
Loader.js.target[message.target] = Loader.js.target[message.target] || {}; Loader.js.target = message.data;
Loader.js.target[message.target].cache = message.cache;
Loader.js.target[message.target].map = message.map;
Loader.notifyWorkers({ Loader.notifyWorkers({
action: 'js-propagate', action: 'js-propagate',
cache: message.cache, data: message.data
map: message.map,
target: message.target
}, worker.pid); }, worker.pid);
break; break;
case 'css-propagate': case 'css-propagate':

@ -112,12 +112,10 @@ module.exports = function(Meta) {
winston.verbose('[meta/js] ' + target + ' minification complete'); winston.verbose('[meta/js] ' + target + ' minification complete');
minifier.kill(); minifier.kill();
if (process.send) { if (process.send && Meta.js.target.length > 1) {
process.send({ process.send({
action: 'js-propagate', action: 'js-propagate',
cache: Meta.js.target[target].cache, data: Meta.js.target
map: Meta.js.target[target].map,
target: target
}); });
} }

Loading…
Cancel
Save