So I currently use BundleTransformer
, LESS
and I'm trying to add the Autoprefixer
post processor. This plugin automatically takes css like transform: scale(1.5)
and converts it to -webkit-transform
and -moz-transform
.
If I am in release mode or have BundleTable.EnableOptimizations=true
then everything works just fine and the prefixes are added as expected.
In debug mode however, all the individual CSS / LESS files in my bundle are present in the HTML as separate requests. I'm using this command in my CSHTML file:
@Styles.Render("~/Content/css/lessbundle")
i.e. In debug mode this gets expanded out to LINK
tags for :
/cs/something.css
/css/lessfile1.less
/css/lessfile1.less
instead of a single file
/Content/css/lessbundle?v=RFAUSIwb-jEuuo4vHNTnTkE2LrN2jfHglX-Hk8HIF481
For the LESS files IIS automatically converts them, however it does not apply the Autoprefixer
.
Is there a way to get Autoprefixer to work when requesting raw .css
and .less
files?
If not it seems kind of pointless to me because the only alternative I see is to request directly the 'Content/css/lessbundle
virtual URL - which will get run through the Autoprefixer
. It will only get minified for a release build.