Nosey Party Murderer

    grunt-simple-typescript

    0.0.3 • Public • Published

    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', '...']);

    Keywords

    none

    Install

    npm i grunt-simple-typescript

    DownloadsWeekly Downloads

    0

    Version

    0.0.3

    License

    none

    Last publish

    Collaborators

    • mixonic