Getting blank index.html when Angular 7 deploy to github

Deadly 提交于 2020-07-10 09:45:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!