Referencing TypeScript Type Definitions Referencing TypeScript Type Definitions typescript typescript

Referencing TypeScript Type Definitions


I hate referencing files. What I do is I just use the "excludes" option in tsconfig.json. This guarantees that all typings files will be included in my entire project and I won't ever have to use any <reference>.

Just use the following tsconfig and you should be good to go:

{  "compilerOptions": {    "target": "es5", // or es6    "module": "system",    "sourceMap": true,    "declaration": true  },  "exclude": [    "node_modules"  ]}

Here's my main file in that module. Notice that there're no references to any declaration file.