【发布时间】:2018-04-28 10:23:13
【问题描述】:
在尝试编译我的打字稿源代码时,我看到编译器也在尝试编译我的 node_modules 文件夹下的类型。 我正在使用 typescript 2.6.1,我的 tsconfig 文件如下
{
"compilerOptions": {
"allowSyntheticDefaultImports":true,
"outDir": "./dist",
"mapRoot": "./dist",
"module": "commonjs",
"target": "es6",
"sourceMap": true,
"sourceRoot": "./source",
"removeComments": false
},
"exclude": [
"node_modules",
"test"
],
"include": [
"source/*.ts"
]
}
当我运行以下命令“tsc -w -p tsconfig.json”时,出现以下错误
node_modules/@types/es6-promise/index.d.ts(11,15): error TS2300: Duplicate identifier 'Promise'.
【问题讨论】:
标签: typescript tsconfig