tscoverage/compile/compile.js
2016-02-16 11:28:57 +01:00

35 lines
877 B
JavaScript

// import gulp
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
g:{
typescript: require("gulp-typescript"),
header: require("gulp-header")
},
mergeStream: require("merge2")
};
plugins.beautylog.log('now compiling NPMTS');
plugins.gulp.task('indexTS', function() {
var tsResult = plugins.gulp.src('../ts/index.ts')
.pipe(plugins.g.typescript({
out:"index.js",
declaration:true
}));
return plugins.mergeStream([
tsResult.dts.pipe(plugins.gulp.dest('../')),
tsResult.js
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest('../'))
]);
});
plugins.gulp.task('default',['indexTS'], function() {
plugins.beautylog.success('Typescript compiled');
});
plugins.gulp.start.apply(plugins.gulp, ['default']);