깃헙 레포지토리의 셋팅탭 => pages => 소스를 master로 바꾸고 save
vsc터미널에서 yarn add gh-pages
package.json에 "homepage": "https://깃허브유저네임.github.io/프로젝트네임/" 추가
스크립트에 predeploy 및 deploy 추가
"scripts": {
.
.
.
"predeploy": "yarn build", // build script를 호출하여 build 디렉터리 생성
"deploy": "gh-pages -d build" // gh-pages를 호출하고 build 디렉터리를 업로드
}
4.npm run deploy // yarn 하니 안됐는데 npm하니 됨
Manifest: Line: 1, column: 1, Syntax error 발생.
index.html의
저 링크부분 주석처리 해주기
빈화면
/public/index.html에 아래 코드 추가
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
"scripts": {
...
"deploy": "cp build/index.html build/404.html && gh-pages -d build",
"predeploy": "npm run build"
},