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-14 18:25:36 +00:00
|
|
|
plugins.beautylog.log('now compiling the mojo.io gulp tasks');
|
|
|
|
|
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']);
|