问题
I have deployed Angular website using Github pages. Entire process is successful but when I am opening the website its showing blank page. Its loading index.html page but still its blank. Can you please help me solve the issue.
Here is the link https://s530860.github.io/website/
https://s530860.github.io/website/
回答1:
If you deploy your website other than the main domain, you need to build it with this type of command.
In your example I can see you have using sub directory url called
/website
. So run this command.ng build --prod --output-path docs --base-href /website/
When the build is complete, make a copy of docs/index.html and name it docs/404.html.
Then push your docs directory to Github.
It is clearly mentioned in the official docs.
Angular Docs - Deploying Github Pages
回答2:
You also need:
--deploy-url /website/
来源:https://stackoverflow.com/questions/55875893/getting-blank-index-html-when-angular-7-deploy-to-github