strarsis / sass-include-paths

Generates include paths for node-sass for packages from popular package managers like npm, bower, ruby gem, ruby bundler.
MIT License
12 stars 3 forks source link

Not picking up paths of bower compenents where "main" points to root of repo #5

Closed dkebler closed 8 years ago

dkebler commented 8 years ago

I wrote a bower only version of this using wiredep but thought I would try this as it's a bit more flexible.

But the bowerComponents function is only returning paths of repos whose "main" key points to a file in a subdirectory of the repo.

For example if bower install "bemiby" it's main file is _bemify.scss in the root of that repo and your code does not add that to the array of paths.

Bower repos like "color-schemer" that have their "main" pointing to subdirectory like "/stylesheets" work fine.

here is my code.

paths: function(data) {
    Debug.L1("in sass paths function")

    let sass_paths = []
    .concat(sassIncl.bowerComponentsSync());
    Debug.L1('paths:\n' +  sass_paths);
    return sass_paths;
strarsis commented 8 years ago

I use this code for the test:

var sassIncl = require('./');

var sass_paths = []
    .concat(sassIncl.bowerComponentsSync());
console.log(sass_paths);

bemify and color-schemer have been installed using bower install.

I get the following array:

[ 'bower_components/bemify/sass',
  'bower_components/color-schemer/stylesheets',
  'bower_components/scss-blend-modes/stylesheets' ]

But 'bower_components/bemify/sass' is in the array.

Node v5.3.0, bower 1.7.9 for color-schemer@0.2.8 and bemify@0.1.2 in this test.

dkebler commented 8 years ago

whoops sorry bemify was not the example with the issue it has main in a subdirectory and works fine

try "normalize-scss": "~3.0.3", https://github.com/appleboy/normalize.scss

or sass-mq, or neutroncss or sass-flex-mixin...... any repo with main file in root of repo.

I'm using node v6.2.1, bower 1.7.7

strarsis commented 8 years ago

Thanks for your report. This issue should be fixed now with release v4.6.0.

dkebler commented 8 years ago

That did it...picks them all up now. Thx