Skip to content

Instantly share code, notes, and snippets.

@vre2h
Last active November 8, 2024 13:45
Show Gist options
  • Save vre2h/da9db3733c238c174d13670fb77c1f1a to your computer and use it in GitHub Desktop.
Save vre2h/da9db3733c238c174d13670fb77c1f1a to your computer and use it in GitHub Desktop.
Simple guide for deploying your react app to Github-Pages.
  1. 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"
@HamzaOztrk
Copy link

thanks

@ShiyuanLin
Copy link

Thanks!

@jaywilliamsapar
Copy link

🔥🔥🔥 Thanks you so much

@jamesdev4you
Copy link

awesome perfect should be favorited by everyone lol

@melanieepearl
Copy link

thanks!

@ogalceran
Copy link

Thanks ༼ つ ◕_◕ ༽つ

@CCBoss09
Copy link

Thank you

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