Search
Duplicate

React ν”„λ‘œμ νŠΈ

React ν”„λ‘œμ νŠΈ 생성

1.
vite 둜 ν”„λ‘œμ νŠΈ
2.
npx 둜 ν”„λ‘œμ νŠΈ
3.
λͺ¨λ“ˆ μ„€μΉ˜

vite 둜 ν”„λ‘œμ νŠΈ 생성

β€’
React ν…œν”Œλ¦Ώμ„ μ§€μ •ν•˜μ—¬ 생성
npm create vite@latest ν”„λ‘œμ νŠΈμ΄λ¦„ -- --template react
PowerShell
볡사
β€’
λŒ€ν™”ν˜•μœΌλ‘œ 생성
npm create vite@latest
PowerShell
볡사

μ„œλ²„ μ‹€ν–‰

npm run dev
Bash
볡사

μ‹œμž‘ μ£Όμ†Œ

npx 둜 ν”„λ‘œμ νŠΈ 생성

npx create-react-app ν”„λ‘œμ νŠΈμ΄λ¦„
PowerShell
볡사

μ„œλ²„ μ‹€ν–‰

npm start
Bash
볡사

μ‹œμž‘ μ£Όμ†Œ

λͺ¨λ“ˆ μ„€μΉ˜

package.json νŒ¨ν‚€μ§€ 관리 파일이 μžˆλŠ” μœ„μΉ˜μ—μ„œ λͺ…λ Ήμ–΄ μ‹€ν–‰
package.json μ—μ„œ μ„€μ •ν•œ μ˜μ‘΄μ„± 라이브러리(dependencies μ†μ„±μ—μ„œ μ§€μ •ν•œ λΌμ΄λΈŒλŸ¬λ¦¬λ“€)κ°€ μ„€μΉ˜λœλ‹€.
node_modules 폴더 μ•ˆμ— 라이브러리 νŒŒμΌλ“€μ΄ μ„€μΉ˜λœλ‹€.
npm install
PowerShell
볡사
npm i
PowerShell
볡사
node_modules 에 μ„€μΉ˜λ˜λŠ” 라이브러리 νŒŒμΌλ“€μ€ 파일 κ°œμˆ˜κ°€ 많고, μš©λŸ‰μ΄ μ»€μ„œ Github λ ˆν¬μ§€ν† λ¦¬μ— μ—…λ‘œλ“œ(PUSH)ν•˜λŠ” 것은 ꢌμž₯λ˜μ§€ μ•ŠλŠ”λ‹€.
λ°˜λ“œμ‹œ .gitignore 둜 λ³€κ²½ 사항 μ œμ™Έ 섀정을 ν•΄ 두어야 ν•œλ‹€.