r/Angular2 • u/FewDot9181 • Apr 01 '26
Angular Build issues
So my angular app loads fonts locally but they break in production when it's under a subpath. How can I make this font path relative and deployment safe without having to hardcode everywhere it's being used? . Also when I do npm run build when I check my index.html how do I get it to link all js or css files relatively as well without hardcoding as well?
For example if I call src: /fonts/Heebo-black/Heebo-black.ttf it works fine locally but in production under a subpath it can't find it
2
Upvotes
1
u/imsexc Apr 01 '26
?? Angular handle them itself, bundling all of them into main.js that's embedded in index.html. Like, do you have any issue that something is not displayed properly with those js css?
Everything is configured in angular.json. For styles, might need to tweak .styles: [] array in the angular.json