[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)

 

posted @   Zhentiw  阅读(27)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源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
点击右上角即可分享
微信分享提示