gulp-tsconfig

0.1.0 • Public • Published

gulp-tsconfig Build Status

Simple gulp plugin that creates a TypeScript project file ('tsconfig.json') for a given glob of sources. Supports ordering of project files via globs, too.

A sample is provided in the gulp-tsconfig-sample repository.

Install

$ npm install --save-dev gulp-tsconfig

Usage

var gulp = require('gulp');
var gulpTsConfig = require('gulp-tsconfig');
 
gulp.task('default', function() {
    var tsConfig = gulpTsConfig({
        tsOrder: [
            '**/app.module.ts', 
            '**/*.module.ts', 
            '**/*.ts'],
        tsConfig: {            
            "compilerOptions": {
                "target": "ES3",
                "removeComments": true,
                "sourceMap": true,
                "noImplicitAny": true,
                "out": "./dist/app.js"
            }
        }
    });
 
    return gulp.src(["./**/*.ts"])
        .pipe(tsConfig())
        .pipe(gulp.dest('.'));
 
    // --> result is a tsconfig.json file.
});

API

tsConfig(options)

options

tsConfig

Type: object
Default: {}

The tsconfig settings (e.g. "compilerOptions") as specified in the TypeScript Wiki.

tsOrder

Type: object
Default: ['**/*.ts']

The order glob. The gulp-order plugin is reused for ordering.

jsBeautifyOptions

Type: object
Default:

{
  indent_size : 4,
  indent_char : ' ',
  preserve_newlines : false,
  wrap_line_length : 80
}

The JSON beautifier options. See js-beautify for options.

License

MIT © Oliver Lohmann

Package Sidebar

Install

npm i gulp-tsconfig

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • olohmann