libsass的递归路径

时间:2015-06-27 19:14:42

标签: recursion gulp-sass libsass

我正在使用gulp-sass来编译node.js中的sass。我使用libsass配置来设置includePaths选项。

以下代码有效

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

...但我想用递归做一些事情并得到相同的结果,类似下列其中一种可能性。就目前而言,使用这些设置我会收到错误:"要导入的文件未找到或不可读"。

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

在罗盘中,这就像设置add_import_path "project/components"

一样简单

1 个答案:

答案 0 :(得分:1)

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'