files, include, exclude

Seulyi Yoo·2022년 7월 15일
0

TypeScript

목록 보기
27/42
post-thumbnail
"filesDefinition": {
      "properties": {
        "files": {
          "description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string"
          }
        }
      }
    },
"excludeDefinition": {
  "properties": {
    "exclude": {
      "description": "Specifies a list of files to be excluded from compilation. The 'exclude' property only affects the files included via the 'include' property and not the 'files' property. Glob patterns require TypeScript version 2.0 or later.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    }
  }
},
"includeDefinition": {
  "properties": {
    "include": {
      "description": "Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    }
  }
},

files, include, exclude?

  • 셋 다 설정이 없으면, 전부 다 컴파일
  • files
    • 상대 혹은 절대 경로의 리스트 배열
    • exclude 보다 강함
  • include, exclude
    • glob 패턴(.gitignore)
    • include
      • exclude 보다 약함
        • 같은 걸 사용하면, .ts / .tsx / .d.ts 만 include (allowJS)
    • exclude
      • 설정 안하면 4가지 (node_modules, bower_components, jspm_packages, ) 를 default 로 제외함
      • 은 항상 제외 (include 에 있더라도)
profile
성장하는 개발자 유슬이 입니다!

0개의 댓글