When configuring the typescript compiler, you can utilize the tsconfig.json
file. This will also give you access to options for finding type definition files using the typeRoots
key.
By default:
All visible "@types" packages are automatically included in your compilation process. this includes packages found in node_modules/@types in any parent folder such as ./node_modules/@types/, ../node_modules/@types/, etc.
If a specific typeRoots is specified, only packages under that root will be included.
Some packages provide their type definitions in a separate @types/<package-name>
package, like Jquery. On the other hand, there are packages like Firebase which come with bundled type definitions.
It's interesting how the typescript compiler can recognize Firebase definitions without needing to adjust the typeRoots
setting. These definitions aren't located in @types directory and shouldn't be picked up by default logic.