todo(lotion): because it's super DRY

This commit is contained in:
Tim Lancina
2015-08-06 11:54:57 -05:00
parent 5e0d49b759
commit 9968b483a6

View File

@ -117,59 +117,33 @@ gulp.task('clean', function(done) {
del(['dist/'], done);
});
gulp.task('transpile.system', function() {
var stream = gulp.src(
[
function transpile(moduleType) {
var stream = gulp.src([
'ionic/**/*.ts',
'ionic/**/*.js',
'!ionic/components/*/test/**/*',
'!ionic/util/hairline.js',
'!ionic/init.js',
'!ionic/util/test/*'
]
)
])
.pipe(cache('transpile', { optimizeMemory: true }))
.pipe(tsc(tscOptions, null, tscReporter))
.on('error', function(error) {
stream.emit('end');
})
.pipe(gulp.dest('dist/js/es6/ionic'))
.pipe(babel(getBabelOptions('ionic')))
.pipe(babel(getBabelOptions('ionic', moduleType)))
.on('error', function (err) {
console.log("ERROR: " + err.message);
this.emit('end');
})
.pipe(gulp.dest('dist/js/es5/system/ionic'))
.pipe(gulp.dest('dist/js/es5/' + moduleType + '/ionic'))
return stream;
});
gulp.task('transpile.common', function() {
var stream = gulp.src(
[
'ionic/**/*.ts',
'ionic/**/*.js',
'!ionic/components/*/test/**/*',
'!ionic/init.js',
'!ionic/util/test/*'
]
)
.pipe(cache('transpile', { optimizeMemory: true }))
.pipe(tsc(tscOptions, null, tscReporter))
.on('error', function(error) {
stream.emit('end');
})
.pipe(gulp.dest('dist/js/es6/ionic'))
.pipe(babel(getBabelOptions('ionic', 'common')))
.on('error', function (err) {
console.log("ERROR: " + err.message);
this.emit('end');
})
.pipe(gulp.dest('dist/js/es5/common/ionic'))
return stream;
});
}
gulp.task('transpile.system', function() { return transpile("system"); });
gulp.task('transpile.common', function() { return transpile("common"); });
gulp.task('transpile', ['transpile.system']);
gulp.task('bundle.js', function() {