gulp-ll
Advanced tools
Comparing version 1.0.1 to 1.0.2
17
index.js
@@ -34,9 +34,16 @@ var spawn = require('child_process').spawn; | ||
GulpLL.prototype._getWorkerArgs = function (task) { | ||
var ll = this; | ||
var ll = this; | ||
var taskIdx = null; | ||
var args = this.args.filter(function (arg) { | ||
return ll.allTasks.indexOf(arg) < 0; | ||
var args = this.args.filter(function (arg, idx) { | ||
var isTaskArg = ll.allTasks.indexOf(arg) > -1; | ||
if (isTaskArg && taskIdx === null) | ||
taskIdx = idx; | ||
return !isTaskArg; | ||
}); | ||
args.push('worker:' + task); | ||
args.splice(taskIdx === null ? args.length : taskIdx, 0, 'worker:' + task); | ||
args.push('--ll-worker'); | ||
@@ -47,2 +54,4 @@ | ||
console.log(taskIdx); | ||
return args; | ||
@@ -49,0 +58,0 @@ }; |
{ | ||
"name": "gulp-ll", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Run CPU-consuming Gulp tasks in the separate processes to achieve faster builds.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -21,3 +21,3 @@ <p align="center"> | ||
``` | ||
npm install gulp-ll | ||
npm install --save-dev gulp-ll | ||
``` | ||
@@ -49,3 +49,3 @@ | ||
configuration (using `time gulp your-task`) to figure out the optimal one. E.g. I was able to reach maximum | ||
performance (approx. 30% faster) by paralleling the heaviest CPU-consuming task out of 3 in my project. | ||
performance (~30% faster) by using *gulp-ll* only for the the heaviest CPU-consuming task out of 3 in my project. | ||
Performance gain also depends on the codebase size: obviously, it will give better results in the big projects. | ||
@@ -67,2 +67,8 @@ | ||
## How I can debug task if it's in separate process? | ||
You can just disable *gulp-ll* by running Gulp with `--no-ll` parameter: | ||
``` | ||
gulp my-task --no-ll | ||
``` | ||
## Caveats | ||
@@ -69,0 +75,0 @@ More likely *gulp-ll* will not work for you if you have global variables set by one task and used by another. |
Sorry, the diff of this file is not supported yet
7889
87
77