1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| "incremental": true, "tsBuildInfoFile": "./buildFile", "diagnostics": true, "target": "ES5", "module": "CommonJS", "outFile": "./app.js", "lib": [],
"allowJS": true, "checkJs": true, "outDir": "./dist", "rootDir": "./", "declaration": true, "declarationDir": "./file", "emitDeclarationOnly": true, "sourceMap": true, "inlineSourceMap": true, "declarationMap": true, "typeRoots": [], "types": [], "removeComments":true, "noEmit": true, "noEmitOnError": true, "noEmitHelpers": true, "importHelpers": true, "downlevelIteration": true, "strict": true, "alwaysStrict": true, "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "strictBindCallApply": true, "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "esModuleInterop": true, "allowUmdGlobalAccess": true, "moduleResolution": "node", "baseUrl": "./", "paths": { "jquery": ["node_modules/jquery/dist/jquery.min.js"] }, "rootDirs": ["src","out"], "listEmittedFiles": true, "listFiles": true , "jsx":"Preserve" "jsxFactory":"" ```
typeRoots和types
声明模块通常会包含一个 index.d.ts 文件,或者其 package.json 设置了 types 字段。
默认的,所有位于 node_modules/@types 路径下的模块都会引入到编译器。 具体来说是,./node_modules/@types 、../node_modules/@types、../../node_modules/@types 等等。
typeRoots 用来指定默认的类型声明文件查找路径,默认为 node_modules/@types 。比如: ```js { "compilerOptions": { "typeRoots": ["./typings"] } }
|