Files and include and exclude

Included is an array that specifies the glob pattern that in turn specifies which files/folders are to be included in the compilation. The array exclude complements include and removes files to be compiled. When both properties are specified, exclude will filter out from the list included files from include. By default, include includes all TypeScript files under the rootDir, hence no need to add an entry to **/*.ts.

Files are rarely used because it is less flexible than include. It allows specifying by path and name which file to compile, instead of using a glob pattern. The pattern approach is more flexible allowing you to configure once instead of having to continually modify the configuration file by adding and removing entries in Files.

Here is an example:

"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dont/compile/*.mock.ts"
]

A final word on these three file configurations is that, contrary to most options, these ones don't reside under compilerOptions but are directly set at the root of the tsconfig.json file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.228.64