ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [React] 3. 프로젝트 배포하기
    Dev_Study/React 2021. 1. 22. 23:18
    반응형

    1. 배포할 프로젝트 경로에서 명령어를 통해 프로젝트 빌드를 해줌( build폴더가 생성됨 )

    npm run build

    # npm을 통해 serve라는 웹서버를 설치하는 명령어

    npm install -g serve

    # serve웹서버 실행시 DocumentRoot를 build 폴더로 지정하는 명령어

    serve -s build

    2. public폴더 밑의 index.html파일의 내용이 빌드되어

       bulid폴더 밑의 index.html로 생성됨


    3. 웹서버의 최상위 경로(Document Root)에 생성된 build폴더밑의 파일들을 넣어주면된다


    4. npm serve를 이용해 배포후 테스트

    -serve웹서버 실행시 DocumentRoot를 build폴더로

    npx serve -s build

    반응형

    'Dev_Study > React' 카테고리의 다른 글

    [React] 2. 프로젝트 구조  (0) 2021.01.22
    [React] 1. React 프로젝트 생성하기  (0) 2021.01.22

    댓글

Designed by Tistory.