8000 [feature request] CNAME file for custom domains is replaced · Issue #7 · angular-schule/angular-cli-ghpages · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[feature request] CNAME file for custom domains is replaced #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PascalTemel opened this issue Feb 17, 2017 · 22 comments
Closed

[feature request] CNAME file for custom domains is replaced #7

PascalTemel opened this issue Feb 17, 2017 · 22 comments

Comments

@PascalTemel
Copy link

If your github pages project is deployed on a custom domain, ngh overwrites this file and it has to be recreated after every push.

@JohannesHoppe
Copy link
Member

That's by design, it overrides everything.
If it wouldn't do that, all the hashed bundles would stay, too!

You have to put a CNAME file into your dist folder.
I should start a wiki! :-)

@PascalTemel
Copy link
Author

It might be intended, but it really seems like bad design. I didnt expect to have to do that since ng gh-pages didnt delete that file either. Maybe its worth discussing this again internally, or rethinking it.

@JohannesHoppe
Copy link
Member
JohannesHoppe commented Feb 17, 2017

Yeah, we have to see. I will keep that issue open for a while, to see other peoples opinion on that issue.
The original angular-cli command got too complicated and now it's gone. 😄 My goal is to keep it simple.

What do you think about a --cname=my.domain.org command line option?
Meanwhile, I created a FAQ:
https://github.com/angular-buch/angular-cli-ghpages/wiki/FAQ

@PascalTemel
Copy link
Author

A command line option would be enough for me.

@JohannesHoppe
Copy link
Member

That's easy.
The quick way: You send a PR! ;-)
The slower way: I will do that if there is some time!

@PascalTemel
Copy link
Author

I don't think I have the necessary know-how to do it, but I might look into it sometime.

@coryshaw1
Copy link

I ended up making an extra build step in my Travis CI config. I added a copy:cname script in my package.json, and just called it after ng build step.

"copy:cname": "cp ./CNAME ./dist/CNAME"

This works fine, but a command line option would be nice!

@JohannesHoppe
Copy link
Member
JohannesHoppe commented Feb 19, 2017

I will add this command (--cname=my.domain.org) in v.0.5.1 together with an option to create the 404.html .

@JohannesHoppe JohannesHoppe added this to the v0.5.1 milestone Feb 19, 2017
@JohannesHoppe JohannesHoppe changed the title CNAME file for custom domains is replaced [feature request] CNAME file for custom domains is replaced Feb 19, 2017
@alexjlockwood
Copy link

Hi there, just wondering did this make it into v0.5.1?

@JohannesHoppe
Copy link
Member

No, now it's planned for 0.5.2. Shouldn't take much time to implement.

@wangkanai
Copy link

I don't see --cname=my.domain.org in 0.5.2 yet??

PS D:\Sources\Wangkanai\Wangkanai> ngh --version
0.5.2
PS D:\Sources\Wangkanai\Wangkanai> ngh --branch=master --cname=wangkanai.com

  error: unknown option `--cname'

@JohannesHoppe
Copy link
Member

Shame on me, still not implemented...

@JaxonWright
Copy link
JaxonWright commented Mar 12, 2018

For Windows, I just made an NPM script in my package.json as the following
"build": "ng build --prod --base-href \"/\" & copy CNAME dist",

The & is how you separate commands on the same line in Powershell

CNAME is just a file with your custom URL in it and that is it. Like "example.com"

@beeman
Copy link
Contributor
beeman commented Apr 7, 2018

Another way to get the CNAME file in place is by creating the file src/CNAME and add CNAME to the assets array in .angular-cli.json.

@JohannesHoppe
Copy link
Member

okokok... i will move this very much up on my free-open-source-work list! 😉

@alexjlockwood
Copy link

Here's what my deploy script looks like to workaround this: https://github.com/alexjlockwood/ShapeShifter/blob/master/package.json#L16

ng build -prod && cp ./CNAME ./dist/CNAME && ./node_modules/.bin/ngh

@JaxonWright
Copy link

@beeman wow. I don't know how I didn't think about that

@bdavies
Copy link
bdavies commented Jul 12, 2018

I've submitted a PR (#42) for review, to address this Feature Request. Tested locally, any feedback would be welcome.

@JohannesHoppe
Copy link
Member

Many thanks for the great work! I will take a closer look this weekend! 👍

@JohannesHoppe
Copy link
Member
JohannesHoppe commented Aug 5, 2018

v.0.5.3 is out. it adds the --cname parameter (PR #42)
many thanks to @bdavies for the PR

@RajuMandala-zz
Copy link

@beeman Thank you

@ChrisDinhNZ
Copy link

Good stuff you guys @bdavies @JohannesHoppe

JohannesHoppe added a commit that referenced this issue Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants
0