mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
todo(lotion): because it's super DRY
This commit is contained in:
74
gulpfile.js
74
gulpfile.js
@ -117,59 +117,33 @@ gulp.task('clean', function(done) {
|
||||
del(['dist/'], done);
|
||||
});
|
||||
|
||||
gulp.task('transpile.system', function() {
|
||||
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')))
|
||||
.on('error', function (err) {
|
||||
console.log("ERROR: " + err.message);
|
||||
this.emit('end');
|
||||
})
|
||||
.pipe(gulp.dest('dist/js/es5/system/ionic'))
|
||||
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', moduleType)))
|
||||
.on('error', function (err) {
|
||||
console.log("ERROR: " + err.message);
|
||||
this.emit('end');
|
||||
})
|
||||
.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() {
|
||||
|
Reference in New Issue
Block a user