Javatpoint Logo
Javatpoint Logo

TypeScript Build Tools

Build tools are programming utilities that help to automate the transformation and bundling of our source code into a single file. A build tool utility is used to build a new version of a program. Building means compiling, linking and packaging the code into the executable form.

The Build tools are usually run on the command line, either in IDE or completely separate from it.

Build tools or build automation is the act of scripting or automating a variety of tasks that developers do in their day-to-day activities. These are:

  • Downloading dependencies.
  • Compiling source code into binary code.
  • Packaging that binary code.
  • Running tests.
  • Deployment to production systems.

Use of build tools or build automation

In small projects, the software developers will manually invoke the build process. This is not a good practice for larger projects because, in larger projects, it is very hard to keep track of what needs to be built, in what sequence and what should be the dependencies in the building process. By using an automation tool, it allows the build process to be more consistent.

Some of the standard build tools that can be integrated with TypeScript is given below:

  1. Browserify
  2. Duo
  3. Duo
  4. Gulp
  5. Jspm
  6. Webpack
TypeScript Build Tools

1. Browserify

Use the Browserify plugin Tsify for compiling TypeScript files.

Install

Install Tsify by using the following command:

Using Command Line Interface

By using the following command compile your code that saves the result in a file named bundle.js.

Using API

2. Duo

Install

Install the Duo plugin by using the following command:

Using Command Line Interface

By using the following command compile your code that saves the result in a file named entry.ts.

Using API

3. Grunt

Use grunt-ts plugin from Grunt for compiling TypeScript files.

Install

Install grunt-ts by using the following command:

Now, you need to include the Grunt config file named gruntfile.js in your project.

4. Gulp

Use gulpt-typescript plugin for compiling TypeScript files.

Install

Install gulp-typescript by using the following command:

Now, you need to include the Gulp config file named gulpfile.js in your project.

5. Jspm

Use jspm plugin for compiling TypeScript files.

Install

Install jspm by using the following command:

Note: Currently TypeScript support in jspm is in 0.16beta

6. Webpack

Use ts-loader plugin for compiling TypeScript files.

Install

Install webpack by using the following command:

Now, you need to include the Webpack config file named webpack.config.js in your project.






Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA