Skip to content

Support for scss files in bower packages #155

@dkebler

Description

@dkebler

For vendor (bower) packages the @import is not necessarily full path to the scss partial as the remaining portion is accessed via code like compass. So dependents won't find it because it's not within the "styles_root".

So I think like I am doing with gulp this node package https://github.com/ck86/main-bower-files
can be used to build an array of paths which Dependents can use to find and open and @import with nothing but the filename, just need to walk through this generated array.

kinda like this maybe

// https://github.com/ck86/main-bower-files
var sassBower    = require('main-bower-files');

// main-bower-files will then grab the full paths for all scss files only from "main" entry in each package's bower.json - 
// Unlike the hardcode in the call below will have to read .bowerrc file instead for actual bower components directory but main-bower-files option can do that I think
var scss_paths = sassBower({
  base: path.join(__dirname, "bower_components"),
  filter: '**/_*.scss'
});

for (var i=0; i<scss_paths.length; i++){
  // we need to use the parent directories of the main files, not the files themselves
  scss_paths[i] = path.dirname(scss_paths[i]);
}

so now check against scss_paths whenever Dependents fails after looking in/below "styles_root"

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions