Angular中tsconfig.json和tsconfig.app.json文件之间的区别 [英] Difference between tsconfig.json and tsconfig.app.json files in Angular

查看:512
本文介绍了Angular中tsconfig.json和tsconfig.app.json文件之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Angular的新手.我使用angular-cli了解有关angular的信息,并找到了文件tsconfig.jsontsconfig.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或使用的includesexcludes.

the difference in configuration could e.g. be the output directory outDir or the includes or excludes used.

这篇关于Angular中tsconfig.json和tsconfig.app.json文件之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆