I would like to create custom functions inside my grunt file (or everywhere) to use with grunt-sass.
I tried with this:
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;
}
}
},
But i correcty get error in C function readFolder: Cannot find module 'node-sass'
(because node-sass in a nested dependency, not a direct).
So I tried forcing with a npm install node-sass
.
But then I get this error in C function readFolder: A SassValue object was expected.
Did someone had the same problem?
The problem is the value of the
setValue
method that must be a SassValue object!I changed in this way and now it works: