gruntjs - grunt-sass and custom functions -


i create custom functions inside grunt file (or everywhere) use grunt-sass.

i tried 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 correcty error in c function readfolder: cannot find module 'node-sass' (because node-sass in nested dependency, not direct).

so tried forcing npm install node-sass. error in c function readfolder: sassvalue object expected.

did had same problem?

the problem value of setvalue method must sassvalue object!

i changed in way , works:

options: {     functions: {         'fakelist()': function() {              var sass = require('node-sass');             var list = new sass.types.list(3);             list.setvalue(0, sass.types.string('a'));             list.setvalue(1, sass.types.string('b'));             list.setvalue(2, sass.types.string('c'));             return list;         }     } },  

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -