gulp-patterns
gulp-patterns copied to clipboard
I think i found a bug in the inject function
John I believe i found a bug in the inject/order functions.
The read option {read: false} is given to the gulp-inject function instead of the gulp.src.
So i got this error because of it:
[14:35:17] Wiring the bower dependencies into the html
[14:35:17] 'wiredep' errored after 51 ms
[14:35:17] Error in plugin 'gulp-inject'
Message:
There is no read
option. Did you mean to provide it for gulp.src
perhaps?
Rg, Stefan
John, it seems that the older version of gulp-inject didn't check on this read option.
[email protected] you use doesn't check on that.
[email protected] does the check and thats why i found the bug.
OR it could be that there was a read option in [email protected] and not any more on [email protected],but i doubt that. I guess you want to have a read-false on the src files, so then the code in the inject and order function is wrong. So I suggest my update.
This is my update how i believe it should be:
function inject(src, label, order) { var options = {read: false}; if (label) { return $.inject(orderSrc(src, order,options),{name:'inject:' + label}); } else { return $.inject(orderSrc(src, order,options)); } }
function orderSrc(src, order,options) { //order = order || ['* /']; return gulp .src(src,options) .pipe($.if(order, $.order(order))); }