简体   繁体   English

tsconfig.json 包含属性

[英]tsconfig.json include property

I am looking at tsconfig.json include property.我正在查看 tsconfig.json include属性。 In official documentation it says 'Specifies an array of filenames or patterns to include in the program.'在官方文档中,它说'Specifies an array of filenames or patterns to include in the program.' And when angular application is created it auto generats this property当创建 angular 应用程序时,它会自动生成此属性

"include": [
    "src/**/*.ts",
    "src/**/*.d.ts"
  ],

But as I see in angular application, the application also works fine when this property is removed.但正如我在 angular 应用程序中看到的那样,删除此属性后,该应用程序也可以正常工作。 So my question is why do we need to include any files using this property, what are we missing if we don't do it?所以我的问题是为什么我们需要使用这个属性包含任何文件,如果我们不这样做,我们会丢失什么?

Its empty by default so I guess its only there for the files .默认情况下它是空的,所以我猜它只存在于files中。

包含的图像

在此处输入图像描述

The include property specifies the files to be included in the TypeScript project. include 属性指定要包含在 TypeScript 项目中的文件。 You can either include files or file paths like./src/** to specify what should be included.您可以包含文件或文件路径,如 ./src/** 以指定应包含的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM