tscoverage/compile/compile.js

35 lines
885 B
JavaScript
Raw Normal View History

2016-01-14 18:25:36 +00:00
// import gulp
var plugins = {
2016-01-18 14:15:15 +00:00
beautylog: require("beautylog"),
gulp: require("gulp"),
g:{
typescript: require("gulp-typescript"),
insert: require("gulp-insert")
},
mergeStream: require("merge2")
2016-01-14 18:25:36 +00:00
};
2016-01-18 14:15:15 +00:00
2016-01-31 21:24:57 +00:00
plugins.beautylog.log('now compiling NPMTS');
2016-01-14 18:25:36 +00:00
2016-01-18 14:15:15 +00:00
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.insert.prepend('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest('../'))
]);
2016-01-14 18:25:36 +00:00
});
2016-01-18 14:15:15 +00:00
plugins.gulp.task('default',['indexTS'], function() {
2016-01-14 18:25:36 +00:00
plugins.beautylog.success('Typescript compiled');
});
2016-01-18 14:15:15 +00:00
plugins.gulp.start.apply(plugins.gulp, ['default']);