[Typescript] Build mode of tsc: tsc -b
A long-awaited feature is smart incremental builds for TypeScript projects. In 3.0 you can use the --build
flag with tsc
. This is effectively a new entry point for tsc
that behaves more like a build orchestrator than a simple compiler.
Running tsc --build
(tsc -b
for short) will do the following:
- Find all referenced projects
- Detect if they are up-to-date
- Build out-of-date projects in the correct order
You can provide tsc -b
with multiple config file paths (e.g. tsc -b src test
). Just like tsc -p
, specifying the config file name itself is unnecessary if it’s named tsconfig.json
.
> tsc -b # Use the tsconfig.json in the current directory
> tsc -b src # Use src/tsconfig.json
> tsc -b foo/prd.tsconfig.json bar # Use foo/prd.tsconfig.json and bar/tsconfig.json
Don’t worry about ordering the files you pass on the commandline - tsc
will re-order them if needed so that dependencies are always built first.
There are also some flags specific to tsc -b
:
--verbose
: Prints out verbose logging to explain what’s going on (may be combined with any other flag)--dry
: Shows what would be done but doesn’t actually build anything--clean
: Deletes the outputs of the specified projects (may be combined with--dry
)--force
: Act as if all projects are out of date--watch
: Watch mode (may not be combined with any flag except--verbose
)
分类:
TypeScript
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2022-09-03 [Typescript] 14. Easy - Parameters
2022-09-03 [Typescript] 13. Easy - Unshift
2022-09-03 [Typescript] 12. Easy - Push
2022-09-03 [Typescript] 11. Medium - Equal
2021-09-03 [Cloud Architect] 4. Introduction to Design for Cost, Performance, & Scalability
2019-09-03 [Dart] Capture and Handle Data Sequences with Streams in Dart
2019-09-03 [Javascript] Run asynchronous functions in sequence using reduce