我想在我的 grunt 文件(或任何地方)中创建自定义函数以与 grunt-sass 一起使用。
我试过这个:
options: {
functions: {
'fakeList()': function() {
var list = new require('node-sass').types.List(3);
list.setValue(0, 'a');
list.setValue(1, 'b');
list.setValue(2, 'c');
return list;
}
}
},
但是我正确地得到error in C function readFolder: Cannot find module 'node-sass'
了(因为 node-sass 在嵌套依赖项中,而不是直接的)。
所以我尝试用npm install node-sass
. 但后来我明白了error in C function readFolder: A SassValue object was expected.
有人有同样的问题吗?