$ yarn init -y
// 전역적으로 설치
$ yarn global add typescript
// or
// 개발의존성 설치
$ yarn add -D typescript
{
"compilerOptions": {
"allowJs": true,
"target": "ES5",
"outDir": "./built",
"moduleResolution": "Node",
"lib": ["ES2015", "DOM", "DOM.Iterable"]
},
"include": ["./src/**/*"]
}
...
"scripts": {
// tsc 명령어는 자바스크립트 파일을 타입스크립트 파일로 변환해준다.
"build": "tsc"
},
...
// 추후 아래 명령어를 통하여 tsconfig.json에서 설정한 outDir 폴더에 src폴더에 포함되는 모든 ts파일이 js 파일로 생성된다.
$ yarn build