tsc 增量构建清除源文件删除时的输出文件

问题描述 投票:0回答:0

我正在尝试增量构建,以加速在本地和 CI 流程的大型项目中从

.js
生成
.ts
。但是,我遇到了一个问题,即在增量构建期间删除源文件不会删除相应的
.js
文件。这给我带来了问题,因为如果我必须在每次构建之前清理文件夹,那么使用增量构建功能就没有意义了。

例子:

.
├── bar.ts
├── foo.ts
├── index.ts
├── package.json
└── tsconfig.json

构建后

npx tsc --build --incremental ./

.
├── bar.js
├── bar.ts
├── foo.js
├── foo.ts
├── index.js
├── index.ts
├── package.json
├── tsconfig.json
└── tsconfig.tsbuildinfo

现在删除

bar.ts
并运行
npx tsc --build --incremental ./

.
├── bar.js
├── foo.js
├── foo.ts
├── index.js
├── index.ts
├── package.json
├── tsconfig.json
└── tsconfig.tsbuildinfo

bar.js
不会被删除

CLI 参数中是否缺少任何内容?文档中没有关于它的信息。

typescript tsc incremental-build
© www.soinside.com 2019 - 2024. All rights reserved.