React GitHub Page에 배포하기

DARTZ·2022년 7월 3일
0

React

목록 보기
3/14

간단하게 리액트로 만든 토이프로젝트를 GitHub Page에 배포하는 방법에 대해서 정리한다.
CRA (Create React App)로 만든 프로젝트를 배포한다.

gh-pages 설치

npm install gh-pages

package.json 수정

  "homepage": "git page 주소", // 추가


  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "deploy": "gh-pages -d build" // 추가
  },

npm run build & deploy

npm run build
npm run deploy

GitHub Push

git add .
git commit -m "배포"
git push
profile
사람들이 비용을 지불하고 사용할 만큼 가치를 주는 서비스를 만들고 싶습니다.

0개의 댓글