Compiling TypeScript to JavaScript

Compiling to JavaScript#

When compiling our TypeScript Modules into valid JavaScript, we have to be mindful of the module system used by the environment that we want to run our code in.

If we want our compiled code to run in Node.js, we can use CommonJS modules, which are supported natively. If we want to run our code in the browser, things get more complicated as we have to choose between the following:

  • ES2015 Modules

  • SystemJS

  • CommonJS

  • AMD

  • UMD


This page is a preview of Beginners Guide to TypeScript

Start a new discussion. All notification go to the author.