39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
// import gulp
|
|
var plugins = {
|
|
beautylog: require("beautylog"),
|
|
gulp: require("gulp"),
|
|
g:{
|
|
typescript: require("gulp-typescript"),
|
|
header: require("gulp-header")
|
|
},
|
|
mergeStream: require("merge2"),
|
|
path: require("path")
|
|
};
|
|
|
|
paths = {
|
|
packageBase: plugins.path.resolve(
|
|
plugins.path.join(__dirname,"../")
|
|
)
|
|
};
|
|
|
|
plugins.beautylog.log('now compiling NPMTS');
|
|
|
|
plugins.gulp.task('indexTS', function() {
|
|
var stream = plugins.gulp.src([
|
|
plugins.path.join(paths.packageBase,'ts/**/*.ts'),
|
|
"!" + plugins.path.join(paths.packageBase,'ts/typings/**/*.d.ts')
|
|
])
|
|
.pipe(plugins.g.typescript({
|
|
target:"ES5",
|
|
module:"commonjs"
|
|
}))
|
|
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
|
|
.pipe(plugins.gulp.dest(plugins.path.join(paths.packageBase, 'dist/')));
|
|
return stream;
|
|
});
|
|
|
|
plugins.gulp.task('default',['indexTS'], function() {
|
|
plugins.beautylog.success('Typescript compiled');
|
|
});
|
|
|
|
plugins.gulp.start.apply(plugins.gulp, ['default']); |