我试图构建并部署angular-tou-of-heroes应用程序到github,但总是在路径中得到重复的应用程序名称。有人能帮我解决这个问题吗?
我的构建命令是ng build --prod --output-path docs --base-href angular-tour-of-heroes,我从Github /doc目录部署的。单击链接时,它会保持重定向到流动路径,其中有两个英雄之旅https://frankxiao008.github.io/angular-tour-of-heroes/angular-tour-of-heroes/
这是我的代码的Github存储库链接。https://github.com/frankxiao008/angular-tour-of-heroes
我遵循了这个指令enter image description here
发布于 2019-10-17 01:55:04
我刚刚拉出了你的项目,并在本地服务器上进行了测试。我认为文档中有一个错误。如果将--base-href设置为x值,则应用程序将使用/x作为基本路径。请参见base tag。
解决方案很简单,通过删除选项使其具有缺省值
ng build --prod --output-path docs或将其设置为当前目录
ng build --prod --output-path docs --base-href .我希望这能有所帮助。
https://stackoverflow.com/questions/58402158
复制相似问题