I have a GitHub pages website that uses a custom domain.
The domain serves a webapp made in Angular but when I access my domain the.js and.css files are not loading and on DevTools/Network I see a 404 Not Found per each.js or.css file I have on the branch assigned to the GitHub pages domain.
It's a common problem in Angular. When you generate the bundles you need to use:
ng build --prod --base-href ./
to set base-href to the root folder containing the bundles. Or if you already deployed the project just edit index.html and change the base tag to
<base href="./">
More information in the docs .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.