【发布时间】:2016-04-14 13:14:42
【问题描述】:
我正在调查为什么我的 Angular 2.0 TypeScript 项目的编译时间在相对较短的时间内从大约 4 秒变为大约 15 秒。
我遇到了非常有用但似乎没有记录的--diagnostics 开关。
例如,这是我现在在我的项目上运行 tsc --noEmit --diagnostics 时得到的结果:
Files: 231
Lines: 50872
Nodes: 170067
Identifiers: 65994
Symbols: 7712123
Types: 407677
Memory used: 600554K
I/O read: 0.43s
I/O write: 0.00s
Parse time: 1.13s
Bind time: 0.34s
Check time: 10.17s
Emit time: 0.00s
Total time: 11.64s
这是我在项目的早期版本上运行相同命令时得到的结果。
Files: 197
Lines: 30882
Nodes: 124208
Identifiers: 46201
Symbols: 5856945
Types: 10989
Memory used: 80412K
I/O read: 0.03s
I/O write: 0.00s
Parse time: 0.60s
Bind time: 0.27s
Check time: 0.93s
Emit time: 0.00s
Total time: 1.79s
Types 的数量增加了很多,Check time 的数量也增加了。
是否可以从--diagnostics 获得更详细/详细的输出?
NodeJS v4.4.3,TypeScript v1.8.10。这是我的tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"noImplicitAny": false,
"noEmitOnError": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"removeComments": false
},
"exclude": [
"node_modules",
"wwwroot",
"typings/main.d.ts",
"typings/main"
]
}
【问题讨论】:
标签: typescript angular