Currently, I am facing a situation where I need to specify to TSC in the tsconfig file that I want to include specific files or subfolders from a folder while ignoring others. How can I achieve this?
For instance:
/.
|-folder 1
|->file2.ts
|->src.ts
|-folder 2 //ignored
|->file1.ts //This file is needed
|->file2.ts //the rest should be ignored
|->...
I would like to include the @types folder from node_modules but ignore everything else due to how we use namespaces in TS. The current configuration in tsconfig.json is as follows:
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"declaration": true,
"removeComments": true,
"sourceMap": true,
"outFile": "Compile/Result.js",
"jsx": "react"
},
"exclude": [
"Compile/Result.d.ts",
"node_modules"
],
"include": [
"node_modules/@types"
]
}
However, this setup does not work at the moment.