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"),
|
2016-02-16 10:28:57 +00:00
|
|
|
header: require("gulp-header")
|
2016-01-18 14:15:15 +00:00
|
|
|
},
|
|
|
|
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
|
2016-02-16 10:28:57 +00:00
|
|
|
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
|
2016-01-18 14:15:15 +00:00
|
|
|
.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']);
|