【发布时间】:2019-09-17 16:43:59
【问题描述】:
我看到很多人在他们的tsconfig.json 中排除了node_modules。
我正在使用具有特定文件夹模式的 include。我还需要排除node_modules 吗?没有编译成 JS 的第三方库(即作为 TS 包含在我的项目中)呢?
{
"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"
]
}
【问题讨论】:
标签: typescript node-modules tsconfig