
npm install gh-pages --save-dev
"homepage": "http://{깃허브 사용자 이름}.github.io/{레포지토리 이름}/"
predeploy와 deploy 추가"scripts": {
//...
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
}
"deploy": "cp build/index.html build/404.html && gh-pages -d build"
SPA 문제 해결
- 브라우저 라우터에 아래와 같이 bashname 추가
<BrowserRouter basename={process.env.PUBLIC_URL}>
npm run deploy 실행