[英]TS18003 error with tsconfig.json inheritance in lerna monorepo
我有一個使用 lerna 作為回購管理器的 monorepo 和帶有tsconfig.json
文件的多個包。 我想要一個自定義的基本tsconfig.json
文件和其他從基本文件繼承的文件。 在具有從基礎文件繼承的tsconfig.json
文件的項目中運行tsc
時,我收到以下錯誤消息:
error TS18003: No inputs were found in config file '[...]/packages/core/tsconfig.json'. Specified 'include' paths were '["../tsconfig/src/"]' and 'exclude' paths were '[]'.
包含路徑實際上應該是./src
(它將解析為[...]/packages/core/src
)在繼承tsconfig.json
而不是../tsconfig/src/
。
我知道繼承將覆蓋鍵而不是合並這一事實,這實際上不是這里的問題。 我已經嘗試設置屬性rootUrl
和baseUrl
,之后意識到include
屬性不受它們的影響。
我錯過了什么?
下面是我的tsconfig.json
文件:
packages/tsconfig/tsconfig.json
:
{
"extends": "@sindresorhus/tsconfig",
"compilerOptions": {
"outDir": "dist",
},
"include": [
"src/",
]
}
packages/core/tsconfig.json
:
{
"extends": "tsconfig"
// This is where the include array should appear upon inheriting
// without the path getting transformed to ../tsconfig/src/
}
我建議嘗試像這樣更改packages/core/tsconfig.json
中的配置:
{
"extends": "../tsconfig/tsconfig",
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.