最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I speed up initial TypeScript compile times - Stack Overflow

programmeradmin4浏览0评论

I have a fairly big TypeScript project (200+ files) and it takes some time (10s+) to boot up when I run it in watch mode (tsc --watch). However once its going it is pretty fast to do a full typecheck TypeScript.

How can I speed up the initial boot of tsc --watch?

I have a fairly big TypeScript project (200+ files) and it takes some time (10s+) to boot up when I run it in watch mode (tsc --watch). However once its going it is pretty fast to do a full typecheck TypeScript.

How can I speed up the initial boot of tsc --watch?

Share Improve this question edited Mar 18, 2019 at 0:52 basarat asked Mar 18, 2019 at 0:35 basaratbasarat 276k60 gold badges473 silver badges527 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 19

TypeScript 3.4 rc got the --incremental compiler option (blog post).

When it is enabled TypeScript will generate a .tsbuildinfo file if there isn't one already (so you still play the 10s+ penalty once). But if it exists, a cold tsc --watch run will be super fast (no longer 10s delay).

How to enable incremental builds

Either with command line flag --incremental or in your tsconfig.json:

{
    "compilerOptions": {
        "incremental": true
    }
}
发布评论

评论列表(0)

  1. 暂无评论