TypeScript tsconfig.json 완전 정리 | 백틱
typescript config
강경원 · 2026년 2월 10일· 읽는 데 약 2분 ♡ 좋아요 조회 0
TypeScript의 tsconfig.json은 컴파일 옵션과 프로젝트 설정을 관리하는 핵심 파일입니다.
이 글에서는 주요 옵션과 실무에서 자주 사용하는 설정을 정리합니다.
1. 기본 구조
{
"compilerOptions" : {
"target" : "ES2020" ,
"module" : "commonjs" ,
"lib" : [ "ES2020" , "DOM" ] ,
"outDir" : "./dist" ,
"rootDir" : "./src" ,
"strict" : true
} ,
"include" : [ "src/**/*" ] ,
"exclude" : [ "node_modules" ]
}
2. 주요 컴파일 옵션
target
컴파일 대상 JavaScript 버전
"target" : "ES2020"
module
댓글
lib "lib" : [ "ES2020" , "DOM" , "DOM.Iterable" ]
3. 엄격 모드 옵션 {
"strict" : true ,
"noImplicitAny" : true ,
"strictNullChecks" : true ,
"strictFunctionTypes" : true ,
"strictBindCallApply" : true ,
"strictPropertyInitialization" : true ,
"noImplicitThis" : true ,
"alwaysStrict" : true
}
4. 모듈 해석 옵션 {
"moduleResolution" : "node" ,
"baseUrl" : "./" ,
"paths" : {
"@/*" : [ "src/*" ]
} ,
"resolveJsonModule" : true
}
5. 실무 설정 예시 {
"compilerOptions" : {
"target" : "ES2020" ,
"module" : "ESNext" ,
"lib" : [ "ES2020" , "DOM" ] ,
"jsx" : "react-jsx" ,
"strict" : true ,
"esModuleInterop" : true ,
"skipLibCheck" : true ,
"forceConsistentCasingInFileNames" : true ,
"moduleResolution" : "bundler" ,
"baseUrl" : "." ,
"paths" : {
"@/*" : [ "src/*" ]
}
}
}
6. 실무 팁
strict 모드 : 프로덕션에서는 strict: true 권장
skipLibCheck : 타입 체크 속도 향상
paths : 절대 경로 import를 위해 사용
extends : 공통 설정은 별도 파일로 분리하여 재사용
tsconfig.json은 "타입 안정성과 개발 경험의 균형"을 맞추는 설정입니다.
백엔드 엔지니어. Java/Spring으로 밥 벌고, 사이드로 Next.js와 실시간 서비스를 만듭니다. 만들면서 배운 것들을 기록해요.