Page 35 -
P. 35
yarn eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd hello-react
yarn start
Happy hacking!
이 명령어를 입력하면 자동으로 리액트 프로젝트에서 필요한 로컬 모듈들을 설치합니다.
1.3.5.3 프로젝트 개발 서버 실행
리액트 프로젝트를 만들면 yarn start 명령어로 프로젝트 개발 서버를 실행할 수 있습니다. 개발
서버는 포트 3000번으로 열리며, 파일을 수정할 때마다 프로젝트를 다시 빌드하고 웹 브라우저를
리로딩합니다.
노트 빌드한다는 것이 뭔가요?
리액트 프로젝트를 ‘빌드’한다는 것은 여러 파일로 분리된 프로젝트를 한 파일로 합치는 것입니다. 이 과정에는 ES6
형태로 작성된 코드를 구 버전 자바스크립트 엔진이 이해할 수 있는 코드로 변환하는 작업도 포함되어 있습니다. ES6
형태의 코드를 변환해야 구 버전 웹 브라우저와 호환할 수 있습니다.
$ cd hello-react
$ npm start
Compiled successfully!
You can now view hello-react in the browser.
Local: http://localhost:3000/
On Your Network: http://172.30.1.55:3000/
Note that the development build is not optimized.
To create a production build, use yarn build.
044
리액트를 다루는 기술(본문출력용)0720.indb 44 2018-07-20 오전 11:25:20