You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deploying to github pages with custom domain is not working correctly #4127
Please provide us with the following information:
When deploying Angular-cli application it uses repository name to define a base path. This is an issue when you deploy application to Github repository witch has custom domain enabled for it's Github pages.
You still need to define repository name to get app deployed but in such case you wouldn't want to have that name as absolute path of your application.
""
in index.html should become
"<base href="{{ REPOSITORY NAME or "/" if custom domain is enabled }}">"
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
All OS
I too am having this same issue. It appears to me that it needs to maintain the <base href="/"> tag instead of trying to inject the repository name. Maybe this could be accomplished in the angular-cli.json file in a `githubPages" object where you could customize the CNAME location and href value.
The CLI could check for the presence of a CNAME file in the repository, and when one is detected, do not modify the base tag.
UPDATE:
I'm looking at this file here, and it looks like there is an option. Trying to figure out how to use it at the moment. github-pages-deploy.run.ts
SOLUTION:
Using Beta 26, I found that running this command will resolve the issue: ng github-pages:deploy --custom-domain customdomain.com
I'm not sure if there is a way to configure the custom domain in the angular-cli.json file, but if there isn't a way, there should be. Right now I have the above script in an npm script.
Additionally, after updating to Beta 26 I had to remove my local gh-pages branch because it wasn't connected to the origin branch anymore for some reason.
I can confirm that it works with angular-cli version 1.0.0-beta.26. I still believe that there should be a better way. GitHub looks at the CNAME file, why can't the CLI?
Activity
MrGrigri commentedon Jan 20, 2017
I too am having this same issue. It appears to me that it needs to maintain the
<base href="/">tag instead of trying to inject the repository name. Maybe this could be accomplished in theangular-cli.jsonfile in a `githubPages" object where you could customize the CNAME location and href value.jevenson commentedon Jan 22, 2017
The CLI could check for the presence of a CNAME file in the repository, and when one is detected, do not modify the base tag.
UPDATE:
I'm looking at this file here, and it looks like there is an option. Trying to figure out how to use it at the moment.
github-pages-deploy.run.ts
SOLUTION:
Using Beta 26, I found that running this command will resolve the issue:
ng github-pages:deploy --custom-domain customdomain.comI'm not sure if there is a way to configure the custom domain in the
angular-cli.jsonfile, but if there isn't a way, there should be. Right now I have the above script in an npm script.Additionally, after updating to Beta 26 I had to remove my local
gh-pagesbranch because it wasn't connected to the origin branch anymore for some reason.MrGrigri commentedon Jan 23, 2017
I can confirm that it works with angular-cli version 1.0.0-beta.26. I still believe that there should be a better way. GitHub looks at the CNAME file, why can't the CLI?
filipesilva commentedon Jan 24, 2017
Fixed by #3392. Sorry it wasn't well documented, we're going through the docs and fixing these gaps nowadays.
@MrGrigri that PR actually creates the CNAME file. You might have one in your project, or you might not.
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.