-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
processing plugin after it is loaded #116
Comments
This is the right and only way to do this. I'm 50/50 on wanting an API to do this. How common is it that plugins need this? I don't want to add yet another config option if this is a very rare case but if enough people need it I'd be open to suggestions. |
plugins.browserSync = plugins.browserSync.create();
plugins.reload = plugins.browserSync.reload;
plugins.underscorify = plugins.underscorify.transform({
extensions: ['tpl']
});
plugins.babelify=babelify.configure({
presets: ["es2015", "react"]
}); Above are some of the plugins that I have been using, and it seems it is quite common for plugins to ask for plugin-specific options for initializing. And Browsersync and Babel are only some of the many popular plugins which have a good user base. |
OK - particularly given babelify then I can see the potential argument. What are your thoughts on a potential API? |
gulpLoadPlugins({
camelize: true,
lazy: true,
rename: {},
parseFns: {
plugin1NameAfterRename: function(pluginInstance) {
var parsedPlugin = doSomethingWith(pluginInstance);
return parsedPlugin;
},
plugin2NameAfterRename: function(pluginInstance) {},
plugin3NameAfterRename: function(pluginInstance) {}
}
});
|
So for babelify you'd have:
I think that's quite nice. I'd rename @callumacrae any thoughts? |
That is exactly what I mean |
@vinitm how do you feel about working on a PR? :) |
sure, I will create a PR |
Closed as of #119 |
Is this the right way of manually calling
plugins.browserSync = plugins.browserSync.create();
after loading plugins or there is some option provided for doing the same?The text was updated successfully, but these errors were encountered: