mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
todo(lotion): because it's super DRY
This commit is contained in:
42
gulpfile.js
42
gulpfile.js
@ -117,59 +117,33 @@ gulp.task('clean', function(done) {
|
|||||||
del(['dist/'], done);
|
del(['dist/'], done);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('transpile.system', function() {
|
function transpile(moduleType) {
|
||||||
var stream = gulp.src(
|
var stream = gulp.src([
|
||||||
[
|
|
||||||
'ionic/**/*.ts',
|
'ionic/**/*.ts',
|
||||||
'ionic/**/*.js',
|
'ionic/**/*.js',
|
||||||
'!ionic/components/*/test/**/*',
|
'!ionic/components/*/test/**/*',
|
||||||
'!ionic/util/hairline.js',
|
'!ionic/util/hairline.js',
|
||||||
'!ionic/init.js',
|
'!ionic/init.js',
|
||||||
'!ionic/util/test/*'
|
'!ionic/util/test/*'
|
||||||
]
|
])
|
||||||
)
|
|
||||||
.pipe(cache('transpile', { optimizeMemory: true }))
|
.pipe(cache('transpile', { optimizeMemory: true }))
|
||||||
.pipe(tsc(tscOptions, null, tscReporter))
|
.pipe(tsc(tscOptions, null, tscReporter))
|
||||||
.on('error', function(error) {
|
.on('error', function(error) {
|
||||||
stream.emit('end');
|
stream.emit('end');
|
||||||
})
|
})
|
||||||
.pipe(gulp.dest('dist/js/es6/ionic'))
|
.pipe(gulp.dest('dist/js/es6/ionic'))
|
||||||
.pipe(babel(getBabelOptions('ionic')))
|
.pipe(babel(getBabelOptions('ionic', moduleType)))
|
||||||
.on('error', function (err) {
|
.on('error', function (err) {
|
||||||
console.log("ERROR: " + err.message);
|
console.log("ERROR: " + err.message);
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
})
|
})
|
||||||
.pipe(gulp.dest('dist/js/es5/system/ionic'))
|
.pipe(gulp.dest('dist/js/es5/' + moduleType + '/ionic'))
|
||||||
|
|
||||||
return stream;
|
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('transpile', ['transpile.system']);
|
||||||
|
|
||||||
gulp.task('bundle.js', function() {
|
gulp.task('bundle.js', function() {
|
||||||
|
Reference in New Issue
Block a user