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
gh-pages looks like what we want indeed, so we just need to document the command in Create React App and test that it works. @Janpot would you be interested in making a pull request?
Also gh-pages will overwrite the CNAME file, because it just always pushes everything from the build folder to the gh-pages branch.
A simple workaround for this problem is to add a CNAME file with the custom domain inside the public folder in your project and it will be copied to the build and deployed.
Reacted by Jesse Buchanan, zkc, Nathan Shane, Pedro Madruga, Joel Aguero, Alex Boffey, Will Crichton, Kyle Case, Travis Hoover, Ahmed Hosny and 6 more
Reacted by David, Paul Berg, Kyle Case, Eelke Boezeman, Im-neko, Nathan Chapman and David Hartsough
Reacted by Jesse Buchanan, Nathan Shane, Im-neko, Nathan Chapman and David Hartsough
I believe this is no longer an issue. I thought I was coming across it, but the problem was that I had not re-run npm run build since adding the CNAME file to public/.
Activity
fson commentedon Sep 16, 2016
We're likely going to change the GitHub deployment instructions to use the simpler
docsfolder inmasterbranch approach (#520).The new set of commands to deploy will be basically:
I think this issue will be fixed by that change?
sylvainbannier commentedon Sep 19, 2016
@fson it think so. thanks.
Janpot commentedon Oct 3, 2016
gh-pages in combination with following script seems to work pretty well for me:
this pushes the build folder to the
gh-pagesbranch. Basically turning that set of comands into a one liner.Edit:
Just saw the discussion under #520.
gh-pagescould be the solution they were looking for.fson commentedon Oct 3, 2016
gh-pageslooks like what we want indeed, so we just need to document the command in Create React App and test that it works. @Janpot would you be interested in making a pull request?Janpot commentedon Oct 4, 2016
@fson done in #841
fson commentedon Oct 4, 2016
Also
gh-pageswill overwrite theCNAMEfile, because it just always pushes everything from the build folder to thegh-pagesbranch.A simple workaround for this problem is to add a
CNAMEfile with the custom domain inside thepublicfolder in your project and it will be copied to the build and deployed.dsernst commentedon Oct 25, 2016
I believe this is no longer an issue. I thought I was coming across it, but the problem was that I had not re-run
npm run buildsince adding theCNAMEfile topublic/.Using @Janpot's recommended
deployscript:rather than the readme's recommendation
would have saved me 20 minutes of debugging the problem.
¯\_(ツ)_/¯Janpot commentedon Oct 25, 2016
@dsernst yeah, not sure why I didn't put my original script. And in retrospect I regret my decision.
from react/create-react-app#654
move CNAME file to /public per react/create-react-app#654 (comment)
Add CNAME which gets copied upon deployment
moved CNAME