Monday, May 4, 2015

Bundling LESS files for your ASP.NET MVC Web Projects

If you are using LESS files in your ASP.NET MVC Project, you will definitely want to take a look at this article which describes how to perform bundling of your LESS files:

Of course, after reading this article, I discovered that there was a much easier way to provide Bundling to my ASP.NET MVC Project through a very handy NuGet package: System.Web.Optimization.Less:

The syntax is incredibly simple and more inline with creating Stylesheet Bundles in general:

You simply include something like the following in your BundleConfig.cs file:
BundleTable.Bundles.Add(new LessBundle("~/Content/bootstrap").Include(



To include the bundle in your ASP.NET MVC Razor View, you then simply add the following:


This article also does a great job of going into greater detail about how to use LESS Bundles in your ASP.NET MVC Web Project:

No comments:

Post a Comment