Typescript module creation AMD vs Common JS

女生的网名这么多〃 提交于 2019-12-04 22:51:26

AMD is used in the browser (e.g RequireJS) : reason is it allows parallel download of files as network latency is a major bottleneck.

CommonJS is used in the server (e.g. nodejs) where files can be read from disk upfront, but you don't want to read a file till you try to use the code it contains.

Here is a video on the subject that further explains this : http://www.youtube.com/watch?v=KDrWLMUY0R0

Are you using require.js? Use AMD

Are you using node.js? Use CommonJS

Don't know what those are? Not using either of them? Don't use external modules.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!