Search code examples
recursiongulp-sasslibsass

recursive paths for libsass


I am using gulp-sass to compile sass in node.js. I am using the libsass config to set the includePaths option.

The following code works:

includePaths: './project/components/controls/selectAgencies/'

...but I would like to do something with recursion and get the same result, something like one of the following possibilities. As it stands right now, with these settings I get error: "file to import not found or unreadable".

includePaths: './project/components/controls/'
// or
includePaths: './project/components/controls/**/'

In compass, this is as simple as setting add_import_path "project/components"


Solution

  • The problem was actually in my sass file. If my include path is

    ./project/components/controls/

    and the sass file lives at

    ./project/components/controls/selectAgencies/_selectAgencies.scss then my .scss file should reflect the rest of the path, like so:

    @import 'selectAgencies/selectAgencies'