This is the boilerplate for the exercise in these slides:
https://docs.google.com/presentation/d/12IEEVFRqIdnvu86zIqB39oYJTbX6VIkAlwLzYnxYkOo/edit#slide=id.p
Create a .env
and a .env.development
in the root of your project.
// .env
HOME_URL="https://[your-github-username].github.io/[remote-repo-name]/"
// .env.development
HOME_URL="http://localhost:8080/"
For react router to work on gh-pages
your env
files should look like this:
HOME_URL="https://myusername.github.io/my-cool-repo/"
ROUTER_BASE_URL="/my-cool-repo"
Add your private keys to .env
(for production) or .env.development
and access them
anywhere in your code by doing process.env.MY_API_KEY
.
Start the local Webpack Dev Server (usually on port 8080
):
yarn start
Lint all JavaScript files in the src
folder:
yarn lint
Build and deploy your app to gh-pages
branch on the GitHub repo:
yarn deploy