I just created a new MVC 5 app on VS 2013 RTM. For some reason background image url in my CSS files were not being transformed.
So, to debug the issue, I created m
I would have liked to put this as a comment under the marked answer. But I do not have the right to do so. The answer helped me. I also found another solution for it. In the Bundle-configuration method add this:
This will avoid the *.min.css file to be included automatically. And the transform will be called.
Regards Hans
I have the same problem. Сlass CssRewriteUrlTransform does not work as I need. I looked at the source code AspNetWebOptimization and found that when Bundle finds a file with ".min", it creates a new BundleFile without transforms from the original BundleFile. The best solution is to turn off the FileExtensionReplacement for these bundles:
var bundle = new StyleBundle("~/bundles/css/font-awesome")
.Include("~/Content/font-awesome.css", new CssRewriteUrlTransform());
bundle.EnableFileExtensionReplacements = false;
bundles.Add(bundle);
It appears the transform does not run if you have the minified version of the CSS. Remove the .min.css file and it should start working.