본문 바로가기

React

배포 /deployment - GitHub Pages, Netlify

 

create-react-app.dev/docs/deployment#github-pages

 

Deployment | Create React App

npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main..js are served with the contents of the /st

create-react-app.dev

 

 

나중에 베포헤서 얻게 될 주소입니다.

 

 

 

yarn build하고 나면 

 

이렇게 build 폴더가 생긴다.

 

빌드하면 webpack이 우리가 작성한 코드들을 최대한 작게 압축해서 클라이언트에 보내려는 파일들이 생깁니다.

webpack은 framwork입니다.

 

deploy 명령어 실행하고 배포되는데 시간이 좀 거릴 수 있어요.

 

 


 

 

npm install netlify-cli -g

실행잘하면 Published라고 마지막에 나옵니다.

 

netlify deploy 실행하고

 

새 브라우저창이 위와 같이 뜨면 승인해주세요

 

 

폴더 build적어주면

 

파란 밑줄 주소로 들어가면 내 프로젝트가 배포된걸 볼수 있어요~!