I\'m trying to have LESS files in my web project, and have the MVC 4 bundling functionality call into the dotLess library to turn the LESS into CSS, then minify the result a
Already some great answers, here's a very simple solution I found for myself when trying to add MVC bundles that regard less files.
After creating your less file (for example, test.less), right click on it and under Web Compiler (get it here) option, select Compile File.
This generates the resulting css file from your less one, and also its minified version. (test.css and test.min.css).
On your bundle, just refer to the generated css file
style = new StyleBundle("~/bundles/myLess-styles")
.Include("~/Content/css/test.css", new CssRewriteUrlTransform());
bundles.Add(style);
And on your view, reference that bundle:
@Styles.Render("~/bundles/myLess-styles")
It should just work fine.