Code Monkey home page Code Monkey logo

grunt-typescript's Introduction

grunt-typescript

Compile TypeScript

Documentation

You'll need to install grunt-typescript first:

npm install grunt-typescript

Then modify your grunt.js file by adding the following line:

grunt.loadNpmTasks('grunt-typescript');

Then add some configuration for the plugin like so:

grunt.initConfig({
    ...
    typescript: {
      base: {
        src: ['path/to/typescript/files/**/*.ts'],
        dest: 'where/you/want/your/js/files',
        options: {
          module: 'amd', //or commonjs
          target: 'es5', //or es3
          base_path: 'path/to/typescript/files'
        }
      }
    },
    ...
});

If you want to create a js file that is a concatenation of all the ts file (like -out option from tsc), you should specify the name of the file with the '.js' extension to dest option.

grunt.initConfig({
    ...
    typescript: {
      base: {
        src: ['path/to/typescript/files/**/*.ts'],
        dest: 'where/you/want/your/js/file.js',
        options: {
          module: 'amd', //or commonjs
        }
      }
    },
    ...
});

â€ģI'm sorry for poor English

grunt-typescript's People

Contributors

kmaru avatar alvivi avatar k-maru avatar suisho avatar vvakame avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.