Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mvc 4 bundling and base64 svg images

I've been experiencing a problem with the Mvc4 bundling&minification feature when using embedded base64 svg images in the css.

Lets say I have a css rule like this:

url("data:image/svg+xml;base64,PD94...<snip>...")

This works fine when bundling and minification is disabled. However, when it is enabled, that rule gets rewritten like this:

url("/content/style/data:image/svg+xml;base64,PD94...<snip>...")

Breaking the url, since it's not a real URL but an embedded base64 image.

Anyone knows how to fix this, beside moving SVG images in standalone files?

Thanks.

like image 243
Matteo Mosca Avatar asked Jan 31 '26 22:01

Matteo Mosca


1 Answers

It was just a bug on DotLess. We updated the nuget package and the problem went away.

like image 186
Matteo Mosca Avatar answered Feb 03 '26 12:02

Matteo Mosca