Cloud

kodaeyong·2021년 4월 14일

cloud 올리는법

npm i gh-pages
gh-pages는 github에 업로드하는 것을 허가해주는 모듈

1.package.json에 올리기

"developent": [...
]
.
.
.
   ]
  },
  "homepage": "https://eodyd6564.github.io/movie_app_2020/"
}

2.scripts에 올리기 "deploy", "predeploy"

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "deploy": "gh-pages -d build",
    "predeploy": "npm run build"
  },
  deploy predeploy 이름 같게해주기
  아니면 동작하지 않는다.

"deploy": build폴더를 upload함
우리가 build폴더를 얻는 방법은 npm rum build를 실행시키는 것

3. npm run deploy
deploy는 기본적으로 predeploy를 호출한다.

4.public >> index.html 가서 title바꿔주면됨
npm run deploy: 업데이트

state를 갖기위해 class component를 가질 필요가 없다. react hook이라는 것 때문이다.

0개의 댓글