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:
87
gulpfile.js
87
gulpfile.js
@ -72,50 +72,29 @@ gulp.task('build', function(done){
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
gulp.task('watch', ['build'], function() {
|
||||||
* Build Ionic sources, with typechecking and debug statements removed
|
watchTask('transpile');
|
||||||
*/
|
|
||||||
gulp.task('build.release', function(done){
|
|
||||||
IS_RELEASE = true;
|
|
||||||
runSequence(
|
|
||||||
'clean',
|
|
||||||
'copy.libs',
|
|
||||||
['bundle', 'sass', 'fonts', 'copy.scss']
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch', function(done) {
|
function watchTask(task){
|
||||||
runSequence(
|
watch([
|
||||||
'copy.libs',
|
'ionic/**/*.ts',
|
||||||
'build',
|
'!ionic/components/*/test/**/*',
|
||||||
'serve',
|
'!ionic/util/test/*'
|
||||||
function() {
|
],
|
||||||
watch([
|
function(file) {
|
||||||
'ionic/**/*.ts',
|
if (file.event === "unlink") {
|
||||||
'!ionic/components/*/test/**/*',
|
deleteFile(file);
|
||||||
'!ionic/util/test/*'
|
} else {
|
||||||
],
|
gulp.start(task);
|
||||||
function(file) {
|
}
|
||||||
if (file.event === "unlink") {
|
|
||||||
deleteFile(file);
|
|
||||||
} else {
|
|
||||||
gulp.start('bundle.system');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
watch('ionic/components/*/test/**/*', function(file) {
|
|
||||||
gulp.start('e2e.build');
|
|
||||||
});
|
|
||||||
|
|
||||||
watch('ionic/**/*.scss', function() {
|
|
||||||
gulp.start('sass');
|
|
||||||
});
|
|
||||||
|
|
||||||
done();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch('ionic/**/*.scss', function() {
|
||||||
|
gulp.start('sass');
|
||||||
|
});
|
||||||
|
|
||||||
function deleteFile(file) {
|
function deleteFile(file) {
|
||||||
//TODO
|
//TODO
|
||||||
// var basePath = file.base.substring(0, file.base.lastIndexOf("ionic/"));
|
// var basePath = file.base.substring(0, file.base.lastIndexOf("ionic/"));
|
||||||
@ -131,7 +110,7 @@ gulp.task('watch', function(done) {
|
|||||||
// gulp.start('bundle.system');
|
// gulp.start('bundle.system');
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
gulp.task('serve', function() {
|
gulp.task('serve', function() {
|
||||||
connect.server({
|
connect.server({
|
||||||
@ -146,6 +125,7 @@ gulp.task('clean', function(done) {
|
|||||||
del(['dist/**', '!dist'], done);
|
del(['dist/**', '!dist'], done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source build tasks
|
* Source build tasks
|
||||||
*/
|
*/
|
||||||
@ -336,9 +316,18 @@ gulp.task('copy.libs', function() {
|
|||||||
return merge([webAnimations, libs]);
|
return merge([webAnimations, libs]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test build tasks
|
* 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', ['e2e.build', 'bundle.system', 'copy.libs', 'sass', 'fonts']);
|
||||||
|
|
||||||
gulp.task('e2e.build', function() {
|
gulp.task('e2e.build', function() {
|
||||||
@ -436,6 +425,7 @@ gulp.task('tests', function() {
|
|||||||
.pipe(gulp.dest('dist/tests'))
|
.pipe(gulp.dest('dist/tests'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demos
|
* Demos
|
||||||
*/
|
*/
|
||||||
@ -544,6 +534,7 @@ gulp.task('build.demos', function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests
|
* Tests
|
||||||
*/
|
*/
|
||||||
@ -559,6 +550,7 @@ gulp.task('karma-watch', function() {
|
|||||||
return karma.start({ configFile: __dirname + '/scripts/karma/karma-watch.conf.js' })
|
return karma.start({ configFile: __dirname + '/scripts/karma/karma-watch.conf.js' })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Release
|
* 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
|
* Docs
|
||||||
*/
|
*/
|
||||||
@ -695,4 +700,4 @@ gulp.task('tooling', function(){
|
|||||||
gulp.src('*tooling/**/*')
|
gulp.src('*tooling/**/*')
|
||||||
.pipe(gulp.dest('dist'));
|
.pipe(gulp.dest('dist'));
|
||||||
})
|
})
|
||||||
})
|
});
|
||||||
|
Reference in New Issue
Block a user