【问题标题】:Extra files while compiling typescript code using tsc command使用 tsc 命令编译打字稿代码时的额外文件
【发布时间】:2019-10-12 12:34:21
【问题描述】:

我新建了一个node开发环境,使用命令安装了typescript npm模块。npm i --save-dev -g typescript

我创建了一个 app.ts 文件 app.ts

console.log("Hello World")

我尝试使用编译它

tsc --extendedDiagnostics app.ts

我得到以下输出

Files:                         6
Lines:                     24817
Nodes:                    111373
Identifiers:               41046
Symbols:                   27913
Types:                      8269
Memory used:              78854K
Assignability cache size:  33122
Identity cache size:           2
Subtype cache size:            0
I/O Read time:             0.01s
Parse time:                0.46s
Program time:              0.48s
Bind time:                 0.31s
Check time:                1.23s
transformTime time:        0.01s
commentTime time:          0.00s
I/O Write time:            0.00s
printTime time:            0.01s
Emit time:                 0.02s
Total time:                2.04s

注意这里的文件数是 6。但是我只编译了一个文件,即 app.ts 谁能解释一下这里还有哪些额外的文件?

【问题讨论】:

    标签: typescript tsc tsconfig


    【解决方案1】:

    一个疯狂的猜测,但我想说这个文件计数不仅包括您的 .ts,还包括默认的 .d.ts 库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-10
      • 2012-09-27
      • 2018-11-03
      • 2018-07-03
      • 1970-01-01
      • 2021-01-24
      • 2018-10-10
      • 2017-02-26
      相关资源
      最近更新 更多