Closed ghost closed 10 years ago
Hey @tUrG0n,
This used to be how it worked - but I then had feedback saying it would be preferred to add tasks to a variable instead. I guess there's no reason why you couldn't call the plugin and pass in this
, maybe like:
require('gulp-load-plugins')({
attachToScope: this
});
How would that sound?
I don't think I would ever make that default behaviour (I personally enjoy the explicit nature of var plugins = ...
) but I wouldn't be against adding something akin to the above.
So the above approach doesn't work, because the scope used inside a gulp.task
block is different to that used outside of one. I'm open to suggestions on this but I'm not sure if it's going to be possible.
No. This should never be supported. Introducing implicit globals is an awful practise. Please close.
Agree - along with the fact that there's no really good solution to how to implement it - I prefer the explicit approach, which most users of this plugin seem to do too (it used to be done implicitly but changed on the basis of feedback), so this won't be being implemented.
This plugin is great.. but is there a way to import gulp modules without then having me to use the
plugins
var?The grunt alternative automagically does that!
Ideally, I'd want to call
clean()
instead ofplugins.clean()
Is this possible?