taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

Wiredep for Images #181

Open CWSpear opened 9 years ago

CWSpear commented 9 years ago

How would you feel about adding support for images?

It doesn't make sense in all use-cases, but it does for the wiredep().png use-case.

For example, if I install select2, which has 2 pngs and a gif listed under the main, then if I have this in my gulp file:

var wiredepDeps = $.wiredep();
gulp.src(_.flatten(wiredepDeps.png, wiredepDeps.gif, wiredepDeps.jpg, wiredepDeps.jpeg, wiredepDeps.svg))
    .pipe(gulp.dest(dest + 'css/'));

then it moves all those images to the css/ folder in dest, and since that's where I'm moving any bower'd css, it would work great.

I say "would work," because wiredep currently skips over images.

There are a couple different ways we could approach actually implementing this, but just to get what I'm talking about working, the bare minimum you could do is change this line to this:

('detectable-file-types', ['png', 'gif', 'jpg', 'jpeg', 'svg'])

Then it works as I described.

Thoughts?

stephenplusplus commented 9 years ago

Sorry man. It sounds good to me. :+1:

CWSpear commented 9 years ago

Aight, I'll put it in my queue. It is a little awkward cuz it's not something that is really "injected," but helps in the extracting part.