- Your package.json file should consist a field
homepage
:
"homepage": "https://<github-username>.github.io/<project-repo>"
2.1. Install gh-pages
via npm:
npm i --save-dev gh-pages
2.2. Or yarn:
yarn add --dev gh-pages
3.1. Add new script
to package.json
via yarn
:
"predeploy": "yarn run build",
"deploy": "gh-pages -d build"
3.2. Or npm
:
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
awesome perfect should be favorited by everyone lol