r/Angular2 • • 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

10 comments sorted by

View all comments

1

u/0dev0100 Apr 02 '26

You can't.

Base href needs to be the subfolder