jonschlinkert / load-plugins

Thin wrapper around resolve-dep for loading plugins from node_modules or local directories. Like load-gulp-plugins, match dep, etc, but works for gulp, grunt, assemble, verb or anything other task runner or build system that uses plugins.
https://github.com/jonschlinkert
MIT License
22 stars 1 forks source link

gulp-postcss has "postcss" stripped automatically #10

Open scotthovestadt opened 9 years ago

scotthovestadt commented 9 years ago

Please support gulp-postcss.

scotthovestadt commented 9 years ago

For anyone that finds this looking for a solution:

require('load-plugins')('gulp-*', { strip: ['gulp'] });

This strips only the gulp prefix.

My recommendation is to make the default behavior to strip the prefix that was passed in and allow the user to strip extra things when he feels like it.

TrySound commented 9 years ago

@jonschlinkert Maybe we need to strip only first part?

jonschlinkert commented 9 years ago

Have you tried passing a custom strip function on the options? We probably need more unit tests for this

TrySound commented 9 years ago

@jonschlinkert Seems like it deeply extended. I will replace it with object-assign.

TrySound commented 9 years ago

@jonschlinkert However extend-shallow is not deep..

jonschlinkert commented 9 years ago

Seems like it deeply extended. I will replace it with object-assign.

Are you saying that strip is being overwritten? seems like options should only be one level deep in this case, so there is no reason to deep merge. if there is, object-assign is identical in result to extend-shallow. I'd rather use mixin-deep.

jonschlinkert commented 9 years ago

even better, we should fix whatever is preventing the options from extending properly.

edit: I think i understood what you were saying in reverse. so I think we're in agreement, but there is still no reason to use object-assign. extend-shallow does the same thing but faster.

TrySound commented 9 years ago

@jonschlinkert I just forgot that extend-shallow is not deep extend.

scotthovestadt commented 9 years ago

Any word on this issue?

TrySound commented 9 years ago

@scotthovestadt

plugins('gulp-*', {
  strip: 'gulp'
});

works fine

TrySound commented 9 years ago

@jonschlinkert Maybe we shouldn't use registry and should leave strip to user?

jonschlinkert commented 9 years ago

yeah I'm refactoring atm. I think that's a good idea