Question

I'm using the Web Essentials extension for Visual Studio 2012. This makes compiling LESS to CSS super easy, maybe too easy – I don't know where compiler options are set.

I would like to turn on strict math mode, but I can't find where to specify this compiler option when using Visual Studio 2012. (LESS compile support in Visual Studio 2012 comes from Web Tools 2012.2.)

These are the LESS options that Web Essentials lets me set:

Visual Studio Options Window

How do I enable strict math mode when compiling LESS to CSS using Visual Studio 2012 (with Web Tools 2012.2 and Web Essentials)?

Was it helpful?

Solution

Here is the manual way ... :-)

Find lessc.wsf, by default in: C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\11.0\Extensions\<some random hash>\Resources\Scripts\lessc.wsf

find this line

var css = tree.toCSS({
    compress: args.compress
});

change it to

var css = tree.toCSS({
    compress  : args.compress,
    strictMath: true        
}); 

Save & Enjoy !

But the long-term solution is to probably file a feature request with the WebEssentials team and ask them to make this optional https://github.com/madskristensen/WebEssentials2013

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top