Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS bundling optimization not handling transitive relative url(...) references #1346

Closed
thescientist13 opened this issue Dec 14, 2024 · 0 comments · Fixed by #1348
Closed
Assignees
Labels
alpha.2 bug Something isn't working CLI v0.31.0
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Dec 14, 2024

Type of Change

Bug

Summary

So there is an issue if you @import a CSS file and that CSS file has references to other files via url(...), the CSS bundling will not pick it up. For example, give a dependency on font-awesome

/* src/styles/main.css */
@import "../node_modules/font-awesome/css/font-awesome.css";

It has references to its own font files

/* /node_modules/font-awesome/css/font-awesome.css */
@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

However, in the browser we will get a 404 for these assets and of course none of the icons will show
Screenshot 2024-12-14 at 9 26 21 AM

Screenshot 2024-12-14 at 9 26 21 AM

You can see the repo here - https://github.com/AnalogStudiosRI/www.analogstudios.net

Details

Admittedly I was aware of this short coming for some time, hence why I had made a dedicated third party plugin for resolving and managing font-awesome related assets, but after the work coming out of #1326 and #1338 this is indeed a solvable problem, and now I can see it working here - AnalogStudiosRI/www.analogstudios.net#101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.2 bug Something isn't working CLI v0.31.0
Projects
Development

Successfully merging a pull request may close this issue.

1 participant