mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(gulpfile): separate source and e2e watch tasks
This commit is contained in:
59
gulpfile.js
59
gulpfile.js
@ -72,24 +72,11 @@ gulp.task('build', function(done){
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Build Ionic sources, with typechecking and debug statements removed
|
||||
*/
|
||||
gulp.task('build.release', function(done){
|
||||
IS_RELEASE = true;
|
||||
runSequence(
|
||||
'clean',
|
||||
'copy.libs',
|
||||
['bundle', 'sass', 'fonts', 'copy.scss']
|
||||
);
|
||||
gulp.task('watch', ['build'], function() {
|
||||
watchTask('transpile');
|
||||
});
|
||||
|
||||
gulp.task('watch', function(done) {
|
||||
runSequence(
|
||||
'copy.libs',
|
||||
'build',
|
||||
'serve',
|
||||
function() {
|
||||
function watchTask(task){
|
||||
watch([
|
||||
'ionic/**/*.ts',
|
||||
'!ionic/components/*/test/**/*',
|
||||
@ -99,23 +86,15 @@ gulp.task('watch', function(done) {
|
||||
if (file.event === "unlink") {
|
||||
deleteFile(file);
|
||||
} else {
|
||||
gulp.start('bundle.system');
|
||||
gulp.start(task);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch('ionic/components/*/test/**/*', function(file) {
|
||||
gulp.start('e2e.build');
|
||||
});
|
||||
|
||||
watch('ionic/**/*.scss', function() {
|
||||
gulp.start('sass');
|
||||
});
|
||||
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
||||
function deleteFile(file) {
|
||||
//TODO
|
||||
// var basePath = file.base.substring(0, file.base.lastIndexOf("ionic/"));
|
||||
@ -131,7 +110,7 @@ gulp.task('watch', function(done) {
|
||||
// gulp.start('bundle.system');
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task('serve', function() {
|
||||
connect.server({
|
||||
@ -146,6 +125,7 @@ gulp.task('clean', function(done) {
|
||||
del(['dist/**', '!dist'], done);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Source build tasks
|
||||
*/
|
||||
@ -336,9 +316,18 @@ gulp.task('copy.libs', function() {
|
||||
return merge([webAnimations, libs]);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Test build tasks
|
||||
*/
|
||||
gulp.task('watch.e2e', ['e2e'], function() {
|
||||
watchTask('bundle.system');
|
||||
|
||||
watch('ionic/components/*/test/**/*', function(file) {
|
||||
gulp.start('e2e.build');
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('e2e', ['e2e.build', 'bundle.system', 'copy.libs', 'sass', 'fonts']);
|
||||
|
||||
gulp.task('e2e.build', function() {
|
||||
@ -436,6 +425,7 @@ gulp.task('tests', function() {
|
||||
.pipe(gulp.dest('dist/tests'))
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* Demos
|
||||
*/
|
||||
@ -544,6 +534,7 @@ gulp.task('build.demos', function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Tests
|
||||
*/
|
||||
@ -559,6 +550,7 @@ gulp.task('karma-watch', function() {
|
||||
return karma.start({ configFile: __dirname + '/scripts/karma/karma-watch.conf.js' })
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Release
|
||||
*/
|
||||
@ -679,6 +671,19 @@ gulp.task('publish.npm', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Build Ionic sources, with typechecking and debug statements removed
|
||||
*/
|
||||
gulp.task('build.release', function(done){
|
||||
IS_RELEASE = true;
|
||||
runSequence(
|
||||
'clean',
|
||||
'copy.libs',
|
||||
['bundle', 'sass', 'fonts', 'copy.scss']
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Docs
|
||||
*/
|
||||
@ -695,4 +700,4 @@ gulp.task('tooling', function(){
|
||||
gulp.src('*tooling/**/*')
|
||||
.pipe(gulp.dest('dist'));
|
||||
})
|
||||
})
|
||||
});
|
||||
|
Reference in New Issue
Block a user