-
Typescript 설치 및 세팅Typescript 2023. 1. 16. 11:05
간단하게 과정만 나열하려고 한다.
npm itit -y
프로젝트 초기설정
npm install typescript
타입스크립트 설치
npx tsc --init
타입스크립트 컴파일러 / 사용할 모듈을 로컬에 저장하지 않고, 매번 최신 버전의 파일만을 불러와서 실행 한 후, 해당 파일을 없애는 방식으로 모듈을 사용하는 것
tsconfig.json 파일 확인해보면, target과 module이 있는데, 이 것을 확인하는 이유는,
컴파일을 하게되면 js 파일이 생성되는데, js파일의 버전(?)을 결정하는 부분이다.
브라우저는 Typescript를 이해하지 못해서, 이렇게 컴파일을 통해서 자바스크립트 파일로 변환 해주어야 한다.
'Typescript' 카테고리의 다른 글
enum 타입, (0) 2023.01.16 함수 타입 (0) 2023.01.16 기본 타입 (0) 2023.01.16