Last active
September 1, 2021 10:33
-
-
Save ciamac-da/cf8fbbe5b57dd000bd6e7dc5e52cc018 to your computer and use it in GitHub Desktop.
This is how to deployment React projects on Github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- Open package.json file and add a homepage at the top before name | |
==> "homepage": "https://<USERNAME>.github.io/<PROJECT NAME>", | |
2- install gh-pages using ==> npm i gh-pages | |
3- Add pre-deploy and deploy to scripts field in package.json file ==> | |
"pre-deploy": "npm run build", | |
"deploy": "gh-pages -d build" | |
4- type npm run pre-deploy in terminal | |
5- type npm run deploy in terminal | |
6- It's Done!:) click on homepage link to see published version of your project! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment