bundles.Add(new StyleBundle("~/a/b/c")
.Include("~/Content/font-awesome.css", new CssRewriteUrlTransform()));
I have this bundling. The font-awesome css has a url defined as url('../fonts/fontawesome-webfont.eot?v=4.0.3') which is valid when the css is located under "~/Content/font-awesome.css" but now its located under "~/a/b"
But CssRewriteUrlTransform does not kick in and rewrite path to url('../../fonts/fontawesome-webfont.eot?v=4.0.3')
Update: If I remove the .min file it CssRewriteUrlTransformstarts to work, bug in web optimization?
https://aspnetoptimization.codeplex.com/workitem/166
Had the same problem with me.
You need to set the Bundle url relative to the folder of your file.
bundles.Add(new StyleBundle("~/Content/fontawesomebundle")
.Include("~/Content/font-awesome.css", new CssRewriteUrlTransform()));
Update:
It appears that CssRewriteUrlTransform doesn't work for min file.
Either use .min file in the include or remove the min file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With