ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
755 stars 113 forks source link

Incorrect relative URL and missing fingerprint for bootstrap icons font #325

Open bjowes opened 3 weeks ago

bjowes commented 3 weeks ago

Our project uses Bootstrap, which includes icon fonts imported through CSS. After a recent update of the WebOptimizer library, the reference to the fonts is incorrect so they are not loaded by the site.

Path to bootstrap CSS: /lib/bootstrap/dist/css/bootstrap.css Path to font file: /lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 Path to bundle where bootstrap CSS is included: /css/bundle.css

The import line in bootstrap CSS for the font file: url("../fonts/glyphicons-halflings-regular.woff2")

WebOptimizer 3.0.420 renders this in the bundle (correct relative path and fingerprint): url("../lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2?v=93DUFX3R5ukJzB3V5fxFMdNdyXY")

WebOptimizer 3.0.422 (and up) renders this in the bundle (incorrect relative path, no fingerprint): url("../../lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2")

The only change between those versions was #320, so the new behavior was introduced there. I spent some time looking through the changes but I'm not familiar enough with the code base to identify the exact root cause.

We can roll back to 3.0.420 for now but I expect that others will bump into this issue too.

daesk commented 3 weeks ago

I just noticed the same issue. Will downgrade, but it would be nice if it would be fixed.

nvirth commented 1 week ago

Same here. Worked with 3.0.396, not working after upgrade to 3.0.426