"esbuild 와 swc 가 타입 빨리 strip. 타입 체크 안 함. 그게 기능."
뭐 함
esbuild (Go) 와 swc (Rust) 가 매우 빠른 TypeScript-to-JavaScript transpiler. 너의 `.ts` 파일 받아서 밀리초 안에 `.js` 파일 만듦. 안 하는 거: 타입 체크. 타입 떼고 emit; 그게 전체 일.
이거 의도적. 타입 체크가 느려 — 그래프 문제니까 (모든 타입이 다른 타입 참조). Transpilation 이 파일별 병렬-friendly. 일 나눠서 — emit 엔 transpiler, 타입 체크엔 `tsc --noEmit` — 빠른 build 와 전체 타입 안전 둘 다 얻음.
어디서 나타나
esbuild 나 swc 거의 직접 안 써. 임베드 됨:
- Vite 가 dev-시점 transpilation 에 esbuild 사용.
- Next.js 가 swc 사용.
- Bun 이 자기 transpiler 사용 (JavaScriptCore 에서 fork).
- tsx (Node TS wrapper) 가 esbuild 사용.
- Vitest 가 esbuild 사용.
Modern TypeScript build tool 어떤 거든 썼으면, esbuild 나 swc 간접적으로 썼어.
직접 쓸 때
Bundling: esbuild src/main.ts --bundle --outfile=dist/bundle.js. Full build pipeline 필요 없는 작은 lib 에. 실험/프로토타입 코드에. Server-side bundling 에.
Fast transpiler + 타입-체크-only `tsc` 가 modern TypeScript build pipeline. Vite, Next, Bun 다 이 모델 따름. 분할이 TypeScript 가 더 이상 느리게 안 느껴지는 이유.