Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamjohnmills/77fd0507678f8be6d9e07213a937cd2b to your computer and use it in GitHub Desktop.
Save iamjohnmills/77fd0507678f8be6d9e07213a937cd2b to your computer and use it in GitHub Desktop.

How to host your stand-alone built React source files on Github Pages

New: git checkout -b public -> remove dist from .gitignore -> add github base url to build configs -> npm run build -> git add/merge -> git commit -> git subtree push --prefix dist origin public

Edit: git checkout public -> git merge master -> npm run build -> git add/merge -> git subtree push --prefix dist origin public

On Github -> Set github page branch to public

Source: https://gist.github.com/cobyism/4730490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment