Share
Reddit
Twitter
Pinterest
Facebook
Google+
StumbleUpon
Tumblr
Delicious
Digg
Setting up ASP.NET MVC 4 and Twitter Bootstrap 3 with LESS
When setting up an ASP.Net MVC 4 application recently, I decided to add Bootstrap 3 into the project. The default NuGet package for Bootstrap (Twitter.Bootstrap) includes the source and the minified versions of the JavaScript and CSS. However, should you want to edit the LESS files and recompile and minify the CSS, you will need a different Bootstrap NuGet package, a minifier adapter NuGet package, and some additional configuration.
Also, while client-side LESS interpretation is great when working in a development environment, it may not be ideal or available for all website visitors. For this reason, you can use the BundleTransformer.Less library, a JavaScriptEngineSwitcher (either JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.Msie - I used Msie in my project), and a minifier adapter (I used BundleTransformer.MicrosoftAjax; you could also use BundleTransformer.Yui) to compile the LESS to CSS and to minify it for performance in those environments.


