반응형
Github 프로젝트 업로드
git init - 프로젝트에 git설치
git add * - .gitignore에 있는 파일 제외하고 모두 올리기
git commit -m 'Initial Commit' // 커밋 - 메시지를 입입력
git remote add origin <https://github.com/{gitID}/{react-project-name}.git> - git 저장소 연결
git push -u origin main - git main 브랜치에 push
프로젝트를 Github 레포지토리에 올린다.
반응형
npm 페키지
$ npm install --save gh-pages
npm로 github page 페키지 설치, 설치가 완료되면 프로젝트에 있는 package.json 파일을 수정해준다.
Package.json 수정
"homepage" 주소를 추가
"homepage": "http://{gitID}.github.io/{react-project-name}"
script 부분에 predeploy, deploy를 추가
"scripts": {..."predeploy": "npm run build",
"deploy": "gh-pages -d build"}
저장하고 터미널창을 열어 npm run deploy를 실행한다.
반응형
'dev > React' 카테고리의 다른 글
React hooks 완벽 정리 - React hooks가 생긴 이유 (1) (0) | 2022.04.25 |
---|---|
React Component 생명주기 (React life Cycle) (0) | 2022.04.09 |
리엑트 ( React ) 핵심 요약 정리 (1) | 2022.03.24 |