ck86 / gulp-bower-files

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

Fallback on package.json if a dependency doesn't have a bower.json #3

Closed nkijak closed 10 years ago

nkijak commented 10 years ago

I've noticed some libraries available via bower (e.g. backbone) don't have bower.json but do have package.json and that has a main property pointing to the correct file.

nkijak commented 10 years ago

This is something I can add if you think it's appropriate.

ck86 commented 10 years ago

Why not? I was already working on it, but I'm struggling at breaking a forEach loop:

var filenames = ["bower.json", ".bower.json", "package.json"];

filenames.forEach(function(filename){
    bowerJsonPath = path.join(packageJson[dependency].basePath, "/", filename);
    if(fs.existsSync(bowerJsonPath)){
        return false; // will not break the loop?!
    }
    bowerJsonPath = null;
});
kokujin commented 10 years ago

This would be great if it worked this way, I had problems with a few components and its just defetas the purpose if one has to override the settings for each of them. I could just as well copy the files manually.

nkijak commented 10 years ago

Merged in