jackfranklin / gulp-load-plugins

Automatically load in gulp plugins
https://github.com/jackfranklin/gulp-load-plugins
MIT License
757 stars 55 forks source link

Rename & ReplaceString #53

Closed TuckerWhitehouse closed 9 years ago

TuckerWhitehouse commented 9 years ago

Would be convenient if the replaceString was prepended to a rename key if it doesn't match the pattern. For example, 6to5 does not match gulp-*, so prepended it with gulp-.

var plugins = require('gulp-load-plugins')({
  rename: { '6to5': 'to5' }
})
jackfranklin commented 9 years ago

I'm a little against this purely because I'd rather be explicit. Correct me if I'm wrong, but you'd like the above to effectively work equivalentlu to:

var plugins = require('gulp-load-plugins')({
  rename: { 'gulp-6to5': 'to5' }
})

This gets complex when the user has changed the replaceString or they have added an array of replacements, because which one do you use then? Indeed, the default replace string in the plugin is actually ['gulp-*', 'gulp.*'] (the docs need to be updated), so I'm not sure this would work reliably without being more harm than good.