I have a react app deployed with git hub pages, using gh-pages
plugin. My package.json
entry look like this.
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build”,
.....
}
Eveything worked fine until I tried to use a custom domain.
I configured the required A and CNAME entry in my domain provider DNS settings.
I created the
CNAME
file in thedevelop
branch. That is the branch that I have checked out on my local machine.I run
npm run deploy
on develop branch on local machine.plugin pushed the build code to
gh-pages
branch on remote.the
gh-pages
branch on remote does not contain theCNAME
file.after every
deploy
I have to manually add the custom-domain from github settings pages section, which eventually create aCNAME
file. And then every works.
Is there a configuration requied in package.json
to force gh-pages
plugin to copy the CNAME file ?