npx (npm 5.2.0이상부터 함께 설치된 커멘드라인 명령어)
=>최신버전 라이브러리를 실행해줌
커맨드창에 npx create-react-app 폴더명 입력후 cd 폴더명
package.json에 dependencies에서 설치내역 확인가능
(react-scripts 가 실제 create-react-app의 라이브러리, @texting-library는 테스팅시 사용, web-vitals: 구글에서 사이트 경험 측정및 개선)
"scripts" 가 직접적인 명령어
npm start > react script 시작, development server 시작
npm run build > react script build, optimized production build 생성
npm install serve -g (serve라는 패키지를 전역으로 설치)
serve -s build (serve 명령어를 -s 옵션으로 build 폴더를 지정하여 실행 :-s옵션은 어떤 라우팅으로 요청해도
index.html을 응답하도록함)
npm text > react scripts text, jest를 통해 text code 실행
npm eject > react script 의 매뉴얼을 자유자재로 바꿀수 있으나 사이드이펙트는 감수
'프론트엔드 공부 > react' 카테고리의 다른 글
npm create-react-app 설치시 몇가지 빈폴더 나오는 경우 (0) | 2021.07.03 |
---|---|
img 절대경로 설정시 Module not fout:Can't resolve '이미지경로' (0) | 2021.06.10 |
componentDidCatch(error,info) (0) | 2021.05.29 |
component 라이프사이클 변경(v16.3이후) (0) | 2021.05.29 |
react component lifycycle (16.3ver이전) (0) | 2021.05.29 |