ligershark / WebOptimizer

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

Font files in Font Awesome #89

Open j-hurst opened 6 years ago

j-hurst commented 6 years ago

I am attempting to use this package in my .NET Core solution; however, I am having an issue with the font files for font awesome.

I am pulling the font awesome CSS files from the node_modules directory using the UseContentRoot function. Then my understanding is I need to use the AdjustRelativePaths function to adjust the URLs. I manually added the font files in my fonts folder under wwwroot.

However, when I load the page I am getting a 404 error cannot load my font file from the node_modules directory.

In my appsettings I disabled caching, memory cache and disk cache.

Any help would be greatly appreciated. Thanks!

DavidEHerbst commented 1 year ago

@j-hurst - Did you ever get a fix/answer to this?

DavidEHerbst commented 1 year ago

@madskristensen - I'm seeing the same issue with .NET 6

Font Awesome references font files like this: url("../webfonts/fa-solid-900.woff2") But in the bundle it becomes: url("../node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2")

Is this scenario supported by WebOptimizer?

What is the correct way to bundle Font Awesome with WebOptimizer?