简体   繁体   中英

Using require syntax instead of module in Typescript

In Typescript 0.9.1.1, if you want to import an external javascript library, you import it using the require function, instead of the module function that you used to use.

The question is, does this mean that Typescript 0.9.1.1 have requirejs as a core part of its libraries?

No - you can choose to use RequireJS or a different module loader if you prefer.

RequireJS isn't built in, so you need to add that if you want it.

The syntax for importing modules is compiled into either AMD (for loaders such as RequireJS) or CommonJS (for loaders such as the NodeJS module loader) - so anything that is compatible with one of those can be used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM