-
Notifications
You must be signed in to change notification settings - Fork 55
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
configure whether plugins should be nested or not. #126
Conversation
Awesome PR, thank you, and great that it's not a breaking change! Do you fancy adding this to the README and also yourself to the package.json contributors? |
@jackfranklin What do you think about renaming |
Hey sorry this is such a slow reply! I was thinking you could go for |
@jackfranklin Sounds good. PR has been updated to |
@@ -68,7 +68,7 @@ gulpLoadPlugins({ | |||
rename: {}, // a mapping of plugins to rename | |||
renameFn: function (name) { ... }, // a function to handle the renaming of plugins (the default works) | |||
postRequireTransforms: {}, // see documentation below | |||
scoped: true // loads all npm scopes like non-scoped packages | |||
maintainScope: true // toggles loadin all npm scopes like non-scoped packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny typo here loadin
@@ -118,19 +118,19 @@ Note that if you specify the `renameFn` options with your own custom rename func | |||
|
|||
## npm Scopes | |||
|
|||
`gulp-load-plugins` comes with [npm scope](https://docs.npmjs.com/misc/scope) support. By default, the scoped plugins are accessible through an object on `plugins` that represents the scope. When `scoped = false`, the plugins are availble in the top level just like any other non-scoped plugins. | |||
`gulp-load-plugins` comes with [npm scope](https://docs.npmjs.com/misc/scope) support. By default, the scoped plugins are accessible through an object on `plugins` that represents the scope. When `maintainScope = false`, the plugins are availble in the top level just like any other non-scoped plugins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: availble
Looks great! Just a couple of typos to fix. Are you comfortable rebasing this over master? It should be a fairly straightforward conflict to solve. If not no worries, I can do that. |
fixed typos and rebased |
Wicked! One final thought - what happens if I depend on |
How about logging a warning? imo 99% of the time, if When logging a warning, I believe it would be easy to output a URL to a wiki page which defines how to resolve this issue. If an error is thrown, then I believe that there will be a lot of GitHub issues created for |
But if we log a warning and continue, Gulp will continue were |
actually looking over the existing code, an error would already be thrown https://github.com/jackfranklin/gulp-load-plugins/blob/master/index.js#L92-L95. |
Perfect, thank you! |
I'll get a new release out soon :) |
Out in 1.4.0 |
allow user to configure whether plugin should be referenced using its package. Default behavior preserves package scope nesting.
maintainScope = true
maintainScope = false