How to use project references in TypeScript 3.0?

后端 未结 2 1956
甜味超标
甜味超标 2020-12-23 01:59

There is this new feature in TypeScript 3.0 called Project References. It suggests better interaction of *.ts modules between themselves. Unfortunately, this is

2条回答
  •  长情又很酷
    2020-12-23 02:27

    it's for typescript libraries you develop, that are used by other typescript application. So for example, if you make some util library like lodash but are actively developing it along side your dependent application, the references in ``tsconfig.json``` lets you reference the source code, and have your dependent application be rebuilt automatically when the util source changes (IE: tsc detects source code changes in the util ts lib)

    In my case specifically, I use the references in conjunction with npm link and git submodules and it's working out a lot better than in the ts 2.x days.

提交回复
热议问题