我正在调查为什么我的Angular 2.0 TypeScript项目的编译时间在相当短的时间内从大约4秒到大约15秒.
@H_403_20@我遇到了非常有用但似乎没有文档的诊断开关.
例如,这里是我现在在我的项目上运行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
类型的数量已经上升,检查时间也是如此.
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" ] }