No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 6b56f12 Feb 7, 2014

README.md

grunt-simple-typescript

A Grunt task for processing TypeScript files as modules. There are other grunt tasks that do this, but none in so simple and direct a manner.

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-simple-typescript --save-dev

To use add the simple-typescript task to your Grunt configuration.

Referencing a Node API in TypeScript

// myLib.ts - expects a node.d.ts in the same dir.

///<reference path='node.d.ts' />
import util = require('util');
util.puts("Howdy!");

Referencing another TypeScript file

// myLib.ts
class MyLib {
  run() {
    // Do something
  }
}

module.exports = MyLib;
// runner.ts
///<reference path='myLib.ts' />

new MyLib().run();

Transpiling your files

Manually run the task with grunt simple-typescript or include it as part of your build task:

grunt.registerTask('build', ['clean', 'simple-typescript', '...']);