Ian*_*ton 11 module typescript
当Anders Hejlsberg在下面的视频中在35:00左右谈论外部模块时......
...为什么文件server.ts需要对node.d.ts的三次斜杠引用,其中hello.ts不需要类似的引用server.ts?
特别是hello.ts他提到intellisense存在加上他可以使用从中导出的项目server.ts.那么三重斜杠引用还能增加什么呢?
bas*_*rat 13
在两种情况下需要三次斜杠引用:
--out您可以使用引用文件/// <reference.import/require使用外部模块时需要组合,即amd/ commonjs.如果您不知道这些意思是什么(amd/commonjs是javascript术语,不是打字稿特定的),您不必关心.只需使用/// <reference和编译--out.
PS:我有一个关于内部模块和外部模块的视频教程:http://www.youtube.com/watch?v = KDrWLMUY0R0&hd = 1
请tsconfig.json用于新项目而不是参考评论:http://basarat.gitbooks.io/typescript/content/docs/project/compilation-context.html
| 归档时间: |
|
| 查看次数: |
6756 次 |
| 最近记录: |