问题描述
我是Angular的新手.我使用angular-cli
了解有关angular的信息,并找到了文件tsconfig.json
和tsconfig.app.json
.两者都是与打字稿相关的,我发现此链接很有用.
I'm a newbie in Angular. I used angular-cli
to learn about angular and I found the files tsconfig.json
and tsconfig.app.json
. Both of these are typescript related and I found this link useful.
但是为什么要使用两个这样的文件?为什么不能将这两个文件中的配置合并到一个文件中?请帮我解决这个问题.
But why two such files has been used? Why can't the configurations in these two files be combined in one file? Please help me figure this out.
推荐答案
没有什么可以阻止您摆脱tsconfig.app.json
.它只是一个附加的配置文件,可让您根据应用调整您的配置.这是例如当您在同一个angular-cli
工作区中有多个应用程序时很有用.
there is nothing that prevents you from getting rid of the tsconfig.app.json
. it's just an additional config file that allows you to adjust your configuration on an app basis. this is e.g. useful when you have multiple apps in the same angular-cli
workspace.
您可以在根文件夹中放置tsconfig.json
,然后在子文件夹app-a
中包含tsconfig.app.json
文件,并在子文件夹app-b
中拥有另一个应用程序,并拥有自己的tsconfig.app.json
,其中包含一个变体的全局配置.
you could have the root folder with the tsconfig.json
and then a sub folder app-a
with a tsconfig.app.json
file and another app in the sub-folder app-b
with it's own tsconfig.app.json
, which contains a variation of the global configuration.
配置上的差异可能例如是输出目录outDir
或使用的includes
或excludes
.
the difference in configuration could e.g. be the output directory outDir
or the includes
or excludes
used.
这篇关于Angular中tsconfig.json和tsconfig.app.json文件之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!