External modules

TypeScript also has the concept of an external module. JavaScript versions before ECMAScript 6 (ES6) don't include native support for external modules. Developers were forced to develop custom module loaders, and the open source community tried to come up with improved solutions over the years. As a result, today, there are several types of module loaders, and each one of them supports at least one module definition syntax.

In general, we can assume that when someone talks about a module, without explicitly specifying whether they are talking about an internal or external module, they are referring to an external module.

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.