We are using the BundleTransformer
in our ASP.NET MVC project to bundle our style files.
This works great, but we noticed that some CSS files are not bundled with our LESS files when we important them in LESS with the @import
CSS at-rule.
Sample in our root LESS file:
/* Import core LESS files */
@import "../core.less";
/* Import jQuery UI stuff*/
@import "../themes/base/core.css";
@import "../themes/base/resizable.css";
@import "../themes/base/accordion.css";
@import "../themes/base/tabs.css";
/* Import more LESS files */
@import "../morestyles.less";
If we look at the files that are downloaded from Chrome, it is clear that the CSS files are not bundled with the root LESS files.
Naturally, we could simply include these CSS files in the BundleConfig and remove the @import
calls, but I was just curious to see if there is a way to have them bundled together.