C.W.K.
Stream
Lesson 01 of 05 · published

`tsc` Mode: noEmit, watch, incremental

~7 min · tooling, tsc, modes

Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete
"tsc 가 한 명령어 아냐 — 여러 blade 가진 스위스 아미 나이프."

가장 많이 쓸 mode

`tsc` — 전체 타입 체크 + emit. Default. 가장 느린 mode; .js 출력 만듦.

`tsc --noEmit` — 타입 체크만. .js 출력 필요 없는 (다른 tool 이 만드니까) CI '컴파일 돼?' 체크에 사용. Full compile 보다 빠름.

`tsc --watch` — 계속 돌고, 파일 변경에 재체크. 빠른 incremental feedback 위해 개발 동안 사용. --noEmit 와 결합하면 지속 타입 체크.

`tsc --incremental` — 타입-체크 state 를 `.tsbuildinfo` 에 cache. 후속 실행이 바뀐 거만 재체크. 큰 프로젝트에 필수.

`tsc -b` / `--build` — project reference build mode. Multi-package monorepo build 조정. 다음 lesson 에서 다룸.

실제 프로젝트가 어떻게 쓰나

전형적 setup: CI 의 타입-전용 체크엔 tsc --noEmit --incremental, 실제 JS emit 엔 vite 또는 esbuild, 개발 IDE/터미널의 지속 feedback 엔 tsc --watch --noEmit. 분리가 의도적 — fast transpiler 가 build 하게 하고; `tsc` 가 타입-체크에 집중하게.

Modern 프로젝트에 emit 용 `tsc` 안 써. Vite, esbuild, swc, Bun, Deno 다 JavaScript 만드는 데 10-100x 더 빠름. 그것들 하게 둬. `tsc` 는 타입-체크만, 동등한 게 없어서.

Code

tsc mode — 흔한 조합·bash
# 타입 체크만 — CI 용.
npx tsc --noEmit

# 지속 타입 체크 — 개발 동안 터미널 pane.
npx tsc --watch --noEmit

# Incremental — 연속 실행 속도 높임.
npx tsc --noEmit --incremental
# 첫 실행이 .tsbuildinfo 씀;
# 후속 실행이 바뀐 거만 재체크.

# Project reference build (다음 lesson).
npx tsc -b

# Full emit — 다른 build tool 없을 때만.
npx tsc

External links

Exercise

작은 TS 프로젝트에서 tsc --noEmit 돌리고, 그다음 tsc --noEmit --incremental 두 번 돌려. 시간 차이 적어. 이제 한 파일에 한 줄 변경 도입하고 incremental 다시 돌려 — 바뀐 파일만 재체크 확인.
Hint
첫 incremental 실행이 전체 state 와 함께 .tsbuildinfo 씀. 두 번째가 그걸 쓰고 더 빠름. 변경 후엔 영향받은 파일만 재체크.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.