Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 1.12 KB

README.md

File metadata and controls

23 lines (15 loc) · 1.12 KB

System.Web.Optimization.Less

PM> Install-Package System.Web.Optimization.Less

Sample:

BundleTable.Bundles.Add(new LessBundle("~/Content/bootstrap").Include(
  "~/Content/less/bootstrap.less",
  "~/Content/less/responsive.less"));

VirtualPathProvider support

Dotless relies on VirtualPathProvider for getting less file sources. System.Web.Optimization itself uses this approach heavily. In LessTransform it is used also for imported files (@import "virtual path" less directive).

Transient virtual files

By creating a custom VirtualPathProvider it is very easy to implement transient or context dependent .less files. For example, it is possible to compile different Bootstrap themes for different clients using the same less bundle. See the demo web application where the custom DynamicFileVirtualPathProvider handles variables.less which is imported in the bundled files. Also, the custom DynamicFileVirtualPathProvider provides different jquery.globalize culture definitions depending on the current culture.

License: MIT