ck86 / gulp-bower-files

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

Adding "main" overrides with an array seems broken #43

Closed jlyonsmith closed 10 years ago

jlyonsmith commented 10 years ago

In my bower.json I start with:

  "dependencies": {
    "bootstrap": "~3.0.0",
    "angular": "~1.2.16",
    "angular-route": "~1.2.16",
    "angulartics": "~0.15.18"
  },
  "overrides": {
    "angulartics": {
      "main": [ "angulartics.js", "angulartics-ga.js"]
    }
  }

My gulpfile.js contains the code:

var gulpBowerFiles = require('gulp-bower-files');

gulp.task('lib', function() {
  return gulpBowerFiles({debugging: true})
    .pipe(gulp.dest('build/lib'));
});

Debugging output from gulp-bower-files is:

[09:14:57] PackageCollection add         bootstrap bower_components/bootstrap
[09:14:57] PackageCollection add         jquery bower_components/jquery
[09:14:57] PackageCollection add         angular bower_components/angular
[09:14:57] PackageCollection add         angular-route bower_components/angular-route
[09:14:57] PackageCollection add         angulartics bower_components/angulartics
[09:14:57] PackageCollection add         jquery-waypoints bower_components/jquery-waypoints
[09:14:57] Package       select file     jquery bower_components/jquery/dist/jquery.js
[09:14:57] Package       select file     angular bower_components/angular/angular.js
[09:14:57] Package       select file     angular-route bower_components/angular-route/angular-route.js
[09:14:57] Package       select file     jquery-waypoints bower_components/jquery-waypoints/waypoints.js
[09:14:57] Package       select file     bootstrap bower_components/bootstrap/dist/js/bootstrap.js
[09:14:57] Package       select file     bootstrap bower_components/bootstrap/dist/css/bootstrap.css
[09:14:57] Package       select file     bootstrap bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
[09:14:57] Package       select file     bootstrap bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg
[09:14:57] Package       select file     bootstrap bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
[09:14:57] Package       select file     bootstrap bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
[09:14:57] Package       select file     angulartics bower_components/angulartics/angulartics.js
[09:14:57] Package       select file     angulartics bower_components/angulartics/angulartics-ga.js

However my build/lib directory does not contain a build/lib/angulartics directory. If I remove the angulartics override, I get the directory with just the default angulartics.js file in it.

jlyonsmith commented 10 years ago

Bit more info. If I use gulp-debug to display the list of files returned by gulpBowerFiles the angulartics files are not in the list.

jlyonsmith commented 10 years ago

OK, I figured it out. I had to change the bower.json file to contain:

  "overrides": {
    "angulartics": {
      "main": [ "src/angulartics.js", "src/angulartics-ga.js"]
    }
  }

I guess I needed to understand the main entry in bower.json a bit better. Cheers.

ck86 commented 10 years ago

! ;)