Typescript `tsc-b foo-bar——注意‘只生成foo,不生成bar

Typescript `tsc-b foo-bar——注意‘只生成foo,不生成bar,typescript,tsc,Typescript,Tsc,我有一个TypeScript包(使用Thread 2作为包管理器),它有两个不同的源代码树: |- src-bin \- src src bin目标节点中的源,而src中的源以浏览器环境为目标。因此,我有两个不同的tsconfig.json文件 我通常使用tsc-b构建它们。src-bin,它工作得很好 然而,在“监视模式”中,tsc仅编译并监视src,而不是src-bin,我实际上能够使用项目参考来解决它: tsconfig.json(对于src): src-bin/tsconfig.jso

我有一个TypeScript包(使用Thread 2作为包管理器),它有两个不同的源代码树:

|- src-bin
\- src
src bin
目标节点中的源,而
src
中的源以浏览器环境为目标。因此,我有两个不同的
tsconfig.json
文件

我通常使用
tsc-b构建它们。src-bin
,它工作得很好


然而,在“监视模式”中,
tsc
仅编译并监视
src
,而不是
src-bin
,我实际上能够使用项目参考来解决它:

tsconfig.json
(对于src):

src-bin/tsconfig.json
(对于src-bin):

现在运行
tsc-b--watch
编译这两个源代码树

{
  "extends": "../tsconfig.base.json",
  "include": ["src/**/*.ts", "src/**/*.tsx"],
  "references": [{ "path": "src-bin" }],
  "compilerOptions": {
    "types": [],
    "rootDir": "src",
    "outDir": "build",
    "noEmit": false,
    "declaration": true,
    "composite": true
  }
}
{
  "extends": "../../tsconfig.base.json",
  "include": ["**/*.ts"],
  "compilerOptions": {
    "types": ["node"],
    "rootDir": ".",
    "outDir": "../build/bin",
    "noEmit": false,
    "declaration": true,
    "composite": true
  }
}