0

It does not look like this is possible because LessTransform will be applied only once all the files have been merged and minified.

public class LessTransform : IBundleTransform
{
    public void Process(BundleContext context, BundleResponse response)
    {
        response.Content = LessWeb.Parse(response.Content, (DotlessConfiguration) ConfigurationManager.GetSection("dotless"));
        response.ContentType = "text/css";
    }
}

Is there a way to preprocess the less files in some way at Bundling time?

smnbss
  • 1,031
  • 1
  • 10
  • 21

1 Answers1

1

I recently had the same needs and wrote a blog post about the solution that I finally came up with. Here

This can be done relatively easy with a nuget package/some web.config changes (detailed after the package installs so excluding here)/a new transformer in your bundling config.

Jared
  • 5,840
  • 5
  • 49
  • 83