tsconfig.json的目的是什么? [英] what is the purpose of tsconfig.json?

查看:1476
本文介绍了tsconfig.json的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读angular2参考,发现了这个tsconfig.json. 我想知道以下参数是什么意思?

I was reading angular2 referrences and found this tsconfig.json. I would like to know what the following parameters mean?

{
    "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
    },
    "exclude": [
    "node_modules"
    ]
}

推荐答案

tsconfig.json文件与TypeScript编译器(tsc)的配置相对应.

The tsconfig.json file corresponds to the configuration of the TypeScript compiler (tsc).

这些链接可以为您提供有关这些属性的详细信息:

These links could give you details about these attributes:

  • http://www.typescriptlang.org/docs/handbook/tsconfig-json.html
  • http://json.schemastore.org/tsconfig
  • https://angular.io/docs/ts/latest/guide/typescript-configuration.html#!#tsconfig

以下是一些提示:

  • 目标:用于编译输出的语言
  • 模块:已编译输出中使用的模块管理器. system用于SystemJS,commonjs用于CommonJS.
  • moduleResolution :用于解析模块声明文件(.d.ts文件)的策略.使用node方法,它们像模块(require('module-name'))一样从node_modules文件夹中加载
  • sourceMap :生成或不生成源地图文件,以在浏览器中直接调试您的应用程序TypeScript文件,
  • emitDecoratorMetadata :为源中的修饰声明发出或不发送设计类型的元数据,
  • experimentalDecorators :是否为ES7装饰器提供实验性支持,
  • removeComments :是否删除评论
  • noImplicitAny :是否允许使用不带类型的变量/参数(隐式)
  • target: the language used for the compiled output
  • module: the module manager used in the compiled output. system is for SystemJS, commonjs for CommonJS.
  • moduleResolution: the strategy used to resolve module declaration files (.d.ts files). With the node approach, they are loaded from the node_modules folder like a module (require('module-name'))
  • sourceMap: generate or not source map files to debug directly your application TypeScript files in the browser,
  • emitDecoratorMetadata: emit or not design-type metadata for decorated declarations in source,
  • experimentalDecorators: enables or not experimental support for ES7 decorators,
  • removeComments: remove comments or not
  • noImplicitAny: allow or not the use of variables / parameters without types (implicit)

这篇关于tsconfig.json的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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