O'Reilly logo

TypeScript: Modern JavaScript Development by Ivo Gabe de Wolff, Vilic Vane, Remo H. Jansen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modules

TypeScript also has the concept of external modules or just modules. The main difference between using modules (instead of namespaces) is that after declaring all our modules, we will not import them using an HTML <script> tag and we will be able to use a module loader instead.

A module loader is a tool that allows us to have better control over the module loading process. This allows us to perform tasks such as loading files asynchronously or combining multiple modules into a single highly optimized file with ease.

Using the <script> tag is not recommended because when a web browser finds a <script> tag, it downloads the file using asynchronous requests. We should attempt to load as many files as possible using asynchronous requests because ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required