CssRewriteUrlTransform does not accept

bundles.Add(new StyleBundle("~/a/b/c") .Include("~/Content/font-awesome.css", new CssRewriteUrlTransform())); 

I have this binding. The font-awesome css has a url defined as url('../fonts/fontawesome-webfont.eot?v=4.0.3') , which is valid when css is under "~/Content/font-awesome.css" but now it is under "~ / a / b"

But CssRewriteUrlTransform does not start and does not rewrite the path to the url('../../fonts/fontawesome-webfont.eot?v=4.0.3')

Update:. If I delete the .min file, it will start working CssRewriteUrlTransform , error in web optimization?

https://aspnetoptimization.codeplex.com/workitem/166

+5
source share
1 answer

I had the same problem.

You need to set the bundle url relative to your file folder.

 bundles.Add(new StyleBundle("~/Content/fontawesomebundle") .Include("~/Content/font-awesome.css", new CssRewriteUrlTransform())); 

Update: CssRewriteUrlTransform does not seem to work for the min file. Either use the .min file in include or delete the min file.

+1
source

All Articles