CRA로 프로젝트를 생성하면 package.json에 아래와 같은 명령어가 추가되어있다.
// package.json
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"serve": "serve -s build",
"build-and-serve": "npm run build && npm run serve"
},
react-scripts는 뭘까?
설치된 패키지 중 하나다.
// package.json
"dependencies": {
"react-scripts": "5.0.1",
},
package.json에 Webpack은 안 보인다. 하지만 react-scripts 패키지를 통해 내부적으로 실행된다.
"start", "build", "test", "eject" 명령어가 해당된다.