From e2bc5f241a91115d464659ac92dd5a4692de53be Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 30 Mar 2016 15:54:45 -0400 Subject: [PATCH] optimizing process.send for js minification --- loader.js | 8 ++------ src/meta/js.js | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/loader.js b/loader.js index 5676a02bbd..7672ebf6dd 100644 --- a/loader.js +++ b/loader.js @@ -122,15 +122,11 @@ Loader.addWorkerEvents = function(worker) { Loader.reload(); break; case 'js-propagate': - Loader.js.target[message.target] = Loader.js.target[message.target] || {}; - Loader.js.target[message.target].cache = message.cache; - Loader.js.target[message.target].map = message.map; + Loader.js.target = message.data; Loader.notifyWorkers({ action: 'js-propagate', - cache: message.cache, - map: message.map, - target: message.target + data: message.data }, worker.pid); break; case 'css-propagate': diff --git a/src/meta/js.js b/src/meta/js.js index 7ee5f0eb17..5da279ed01 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -112,12 +112,10 @@ module.exports = function(Meta) { winston.verbose('[meta/js] ' + target + ' minification complete'); minifier.kill(); - if (process.send) { + if (process.send && Meta.js.target.length > 1) { process.send({ action: 'js-propagate', - cache: Meta.js.target[target].cache, - map: Meta.js.target[target].map, - target: target + data: Meta.js.target }); }