Many developers are excluding the node_modules
folder in their tsconfig.json
. I, on the other hand, am using the include
directive with specific folder patterns. Do I really need to exclude node_modules
? And what about third-party libraries that aren't compiled into JavaScript (i.e., included in my project as TypeScript)?
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"declaration": true,
"declarationDir": "builds",
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"importHelpers": true,
"jsx": "preserve",
"jsxFactory": "Vue",
"lib": ["dom", "dom.iterable", "esnext", "scripthost"],
"module": "esnext",
"moduleResolution": "node",
"paths": {
"@/*": ["*"]
},
"sourceMap": true,
"strict": true,
"target": "esnext",
"types": ["jest", "node", "vuetify", "webpack-env"],
"typeRoots": ["node_modules/@types"]
},
"include": [
"codes/**/*.ts",
"codes/**/*.tsx",
"shims/**/*.ts"
]
}