ck86 / gulp-bower-files

Build gulp.src() of your bower packages main files.
80 stars 13 forks source link

Use custom directory when overriding #24

Closed ivandotv closed 10 years ago

ivandotv commented 10 years ago

I'm trying to do an override with a custom directory structure, currently I don't think it's possible.

  "overrides": {
    "jquery": {
      "main": ["./dir_1/dir_2/jquery.min.js","./dir_1/dir_2/jquery.min.map"]
    }

I always get jquery/dist/jquery.min.js Original jquery (bower file) : "main": "dist/jquery.js"

ck86 commented 10 years ago

Can you tell me what you are expecting?

Should this plugin select jquery.min.js and jquery.min.map in dir_1/dir_2?

ivandotv commented 10 years ago

It's selecting the correct files but it's not making the directories. So files end up in /jquery/dist/ But i need them in /jquery/dir_1/dir_2/

ck86 commented 10 years ago

This is because the base option for gulp.src will be set to the path where your bower_components directory if this option is not set.

ivandotv commented 10 years ago

I'm not really sure what you are trying to explain. This is how I'm using the plugin.

    gulpBowerFiles().pipe(gulp.dest("./client/vendor"));

So I expect to get files is client/vendor/jquery/dir_1/dir_2/jquery.min.js But I get the files in client/vendor/jquery/dist/jquery.min.js

ck86 commented 10 years ago
  "overrides": {
    "jquery": {
      "main": ["./dir_1/dir_2/jquery.min.js","./dir_1/dir_2/jquery.min.map"]
    }

With this override option you can change the source path, not the destination.

If you have the following bower_components structure: ./bower_components/jquery/dist/jquery.min.js

The base option will be set to: ./bower_components

So if you copy to: client/vendor

You will get: client/vendor/jquery/dist/jquery.min.js

You will not be able to affect the destination path. What is your intention? May be there is another way to solve this problem.

ivandotv commented 10 years ago

Okay so I misunderstood the overrides functionality. Basically what I need to do is change the destination.

ck86 commented 10 years ago

But why? Whats wrong with dist/jquery.min.js?

ck86 commented 10 years ago

Anyway this plugin has nothing to do with destination path, you can use gulp-flatten and/or gulp-filter to solve this problem.

Hope this will help you.

ivandotv commented 10 years ago

I'll look in to that, thank you.