Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

4.11. Tasks automation

		
// including plugins
var gulp = require('gulp');
var watch = require('gulp-watch');

gulp.task('watch', function() {
    watch(__dirname + "/css/**/*.css", function() {
        gulp.run('minify-css');
    });
    watch(__dirname + "/js/**/*.js", function() {
        gulp.run('minify-js');
    });
});		
		
		
		
gulp watch		
		
		

4.11.1. notify

var notify = require('gulp-notify');
			
			
.pipe(notify({ message: 'Styles task complete' }));
			
			

4.11.2. del

			
// Clean
gulp.task('clean', function() {
	return del(['dist/styles', 'dist/scripts', 'dist/images']);
});
			
			

4.11.3. start

			
// Default task
gulp.task('default', ['clean'], function() {
	gulp.start('styles', 'scripts', 'images');
});