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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -