Javascript/react
Typescript로 프로젝트 시작하기(1/n) - 프로젝트 생성
서앶인
2022. 3. 15. 16:28
React + Typescript를 사용하여 프로젝트를 만들어보자.
1. 명령 프롬포트(cmd)를 사용해도 되고, 사용하는 개발 툴의 터미널을 사용해도 됨.
npx create-react-app my-app --template typescript
- my-app : 프로젝트 명. 원하는 이름으로 수정
- node version >= 14 (nvm 사용 권장)
2. 시작
npm start
- http://localhost:3000 으로 실행
3. 폴더 구조
my-app/
node_modules
public/
favicon.ico
index.html
logo192.png
logo512.png
manifest.json
robots.txt
src/
App.css
App.test.tsx
App.tsx
index.css
index.tsx
logo.svg
react-app-env.ts
reportWebVitals.ts
setupTests.ts
.gitignore
package-lock.json
package-json
README.md
tsconfig.json
- .gitignore 설정:
https://www.toptal.com/developers/gitignore
참고: https://create-react-app.dev/docs/getting-started
Getting Started | Create React App
Create React App is an officially supported way to create single-page React
create-react-app.dev