Answer the question
In order to leave comments, you need to log in
How to declare all plugins in gulpfile.js with 1 require?
I heard somewhere that some advanced progers do this. But I still don't understand how to do it? And is it necessary? Is it an alternative to gulp-load-plugins and will it give me a speed boost?
Answer the question
In order to leave comments, you need to log in
You can make an additional wrapper so that everything does not load every time:
var task = function(name, path, options) {
options = options || {};
return gulp.task(name, function(cb) {
var call = require(path).call(this, options);
return call(cb);
});
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question