如果我将此exclude
块添加到我的tsconfig.json
文件中:
"exclude": ["angular-package-format-workspace"]
以下错误出现在VSCode中。如果我删除了exclude
块,它们就会消失(另外,exclude块也具有预期的效果-所以很好奇VSCode为什么绘制错误):
SON schema for the TypeScript compiler's configuration file
Cannot write file '/home/ole/Github/slice/target/dist/index.d.ts' because it would overwrite input file.ts
Cannot write file '/home/ole/Github/slice/target/dist/index.d.ts' because it would overwrite input file.ts
Cannot write file '/home/ole/Github/slice/target/dist/index.d.ts' because it would overwrite input file.ts
这是我的tsconfig.json
文件:
{
"compilerOptions": {
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["es2017"], /* Specify library files to be included in the compilation. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./target", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"strictNullChecks": false, /* Enable strict null checks. */
"baseUrl": "./", /* Base directory to resolve non-absolute module names. */
"paths": {
"@fs/*": ["./src/*"],
"@test/*": ["./test/*"]
}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"plugins": [
{ "transform": "typescript-transform-paths" },
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
],
"rootDirs": ["./src/"], /* List of root folders whose combined content represents the structure of the project at runtime. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */
},
"exclude": ["angular-package-format-workspace"]
}
答案 0 :(得分:1)
尝试添加该块,保存,然后重新启动Visual Studio Code。
Visual Studio Code在运行时会保存打开的文件,这可能与其他尝试对其进行读写的程序冲突。