We're using gulp-less to compile LESS files to css. The problem is that we have calc() statements in the less files which we want the less compiler to copy over to the css as-is, instead of evaluating them during compilation.
When invoking lessc from the command line, this is easily done using
lessc --strict-math=on
But how to do it from the gulp script?
I've tried adding the option to the task parameter, like so:
gulp.task('less', function() {
return gulp.src(<my less files>)
.pipe(less({
'strict-math': 'on', // this is what I tried to add
paths : [ <my less paths> ]
}))
.pipe(gulp.dest(<my css path>));
});
.. but to no avail. Is it possible? Any work-arounds or alternatives if not?
Dash separated named options are in camelCase in javascript, try this :
.pipe(less({
strictMath: 'on', // this is what you have to do
paths : [ <my less paths> ]
}))