- Node.js μ€μΉνκΈ° (npx μ¬μ©νκΈ° μν΄)
npx create-react-app {ν΄λ μ΄λ¦}
- ν΄λ μ΄λ¦μ
.
μ μ λ ₯ β νμ¬ λλ ν 리
- ν΄λ μ΄λ¦μ
npm start
- Starts the development server.
- 리μ‘νΈ κ°λ°νκ²½μ΄ μ€νλλ©° μ½λ©μ ν μ μλ νκ²½μ΄ λμν¨.
- 3000λ² ν¬νΈμ 리μ‘νΈκ° μ€νλ¨
npm run build
- Bundles the app into static files for production.
- build
- λ°°ν¬νμ λ§λλ κ³Όμ
npx serve -s build
- buildν κ²°κ³Όλ₯Ό μλΉμ€ν λ serveλΌκ³ νλ appμ μ°κ² λ€
- serveλ μΉ μλ².
- -s : μ¬μ©μκ° μ΄λ€ κ²½λ‘λ‘ λ€μ΄μ€λ index.html νμΌμ μλΉμ€νλ€.
- -s build : build ν΄λ μμ index.html νμΌμ μλΉμ€νλ€.
- serveλ μΉ μλ².
- buildν κ²°κ³Όλ₯Ό μλΉμ€ν λ serveλΌκ³ νλ appμ μ°κ² λ€
npm test
react-app/src/index.js
- μ ꡬ νμΌ
npm start
λ₯Ό ν΄μcreate-react-app
μ ꡬλμν€λ©΄index.js
λ₯Ό μ°Ύκ³ κ±°κΈ°μ μ νμλ λλ‘ λμν¨