dailylog 7-12-20
How to host react app on Github pages
- Download gh-pages
yarn add gh-pages
- Add
homepage
topackage.json
"homepage": "https://aaroncaraway.github.io/umre-todo/"
- Update
scripts
section ofpackage.json
to includepredeploy
anddeploy
"scripts": {
"start": "react-scripts start",
"predeploy": "yarn build",
"deploy": "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
-
!! IMPORTANT !! Run
yarn deploy
-
In project repo on github, go to settings and host pages from
gh-pages
branch