Skip to content

rocketpack/grunt-typescript

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
          sourcemap: true,
          fullSourceMapPath: true,
          declaration: true,
        }
      }
    },
    ...
});

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.8%
  • TypeScript 0.2%