@Dale-Lin
2022-09-15T16:45:09.000000Z
字数 2193
阅读 297
TypeScript
files
extends
取决于运行时,可以通过 extends
字段来选择继承的 tsconfig.json,TS 仓库提供了一些基本配置
{
"extends": "@tsconfig/node/12/tsconfig.json",
"compilerOptions": {
"preserveConstEnums": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
include
exclude
references(指定一组包含 tsconfig.json 的 project path)
compilerOptions
watchOptions
allowUnreachableCode
allowUnusedLabels
alwaysStrict
exactOptionalPropertyTypes
noFallthroughCasesInSwitch
noImplicitAny
noImplicitOverride
noImplicitReturns
noImplicitThis
noPropertyAccessFromIndexSignature
noUncheckedIndexedAccess
noUnusedLocals
noUnusedParameters
strict
strictBindCallApply
strictFunctionTypes
strictNullChecks
strictPropertyInitialization
useUnknownInCatchVariables
allowUmdGlobalAccess
baseUrl
module
moduleResolution
moduleSuffixes
noResolve
paths
resolveJsonModule
rootDir
rootDirs
typeRoots
types
declaration
declarationDir
declarationMap
downlevelIteration
emitBOM
emitDeclarationOnly
importHelpers
importsNotUsedAsValues
inlineSourceMap
inlineSources
mapRoot
newLine
noEmit
noEmitHelpers
noEmitOnError
outDir
outFile
If specified, all global (non-module) files will be concatenated into the single output file specified.
If module is system or amd, all module files will also be concatenated into this file after all global content.
preserveConstEnums
Do not erase const enum
declarations in generated code.
preserveValueImports
removeComments
sourceMap
sourceRoot
stripInternal
noErrorTruncation
preserveWatchOutput
pretty
allowJs
checkJs
maxNodeModuleJsDepth
allowSyntheticDefaultImports
esModuleInterop
forceConsistentCasingInFileNames
isolatedModules
preserveSymlinks
emitDecoratorMetadata
experimentalDecorators
jsx
jsxFactory
jsxFragmentFactory
jsxImportSource
lib
moduleDetection
noLib
reactNamespace
target
useDefineForClassFields
composite
The composite option enforces certain constraints which make it possible for build tools (including TypeScript itself, under --build mode) to quickly determine if a project has been built yet.
rootDir
默认需要指定include
或 files
里指定,否则 tsc
会通知错误declaration
默认是 truedisableReferencedProjectLoad
disableSolutionSearching
disableSourceOfProjectReferenceRedirect
incremental
tsBuildInfoFile
配置 tsc -w
的选项
- watchFile
watchDirectory
fallbackPolling
synchronousWatchDirectory
excludeDirectories
excludeFiles