我想要配置柏在我的项目。 我碰到的一个问题稿配置柏和我需要你的帮助! 这是我的项目看起来像:
fronend/
- cypress/
-tsconfig.json
- src/
- tsconfig.json
- package.json
- cypreess.json
这是我的tsconfig.json从柏目录:
{
"extends": "../tsconfig.json",
"include": ["./**/*.ts"],
"exclude": [],
"compilerOptions": {
"types": ["cypress"],
"lib": ["es2015", "dom"],
"isolatedModules": false,
"composite": true
}
}
这是我的tsconfig.json文件从前端目录:
{
"compilerOptions": {
"baseUrl": "src",
"rootDir": "src",
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.svg"],
"exclude": ["node_modules", "scripts"],
"references": [
{
"path": "./cypress/"
}
]
}
柏可以工作好不 "extends": "../tsconfig.json"
但我需要它,因为我想到出口文件从来源目录在我的柏ts文件。
可以请你给我的想法是什么是错的我的配置? 我希望不会改变主tsconfig.json文件,因为它运行我们的用户界面。 这是我的错误:
File '/**/fronend/cypress/support/objects/client.ts' is not under 'rootDir' '/**/frontend/src'. 'rootDir' is expected to contain all source files.
The file is in the program because:
Imported via '../../support/client' from file '/**/frontend/cypress/integration/EndToEndTests.spec.ts'
Matched by include pattern './**/*.ts' in '/**/frontend/cypress/tsconfig.json'ts(6059)
tsconfig.json(3, 15): File is matched by include pattern specified here.