gulp runs all tasks, not just default
Created by: enyo
I have this gulpfile:
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var myth = require('gulp-myth');
var cssSourceFiles = __dirname + '/css_source/*.css';
var cssTarget = __dirname;
// Lint Task
gulp.task('myth', function() {
gulp.src(cssSourceFiles)
.pipe(myth())
.pipe(gulp.dest(cssTarget));
});
// Lint Task
gulp.task('watch', function() {
gulp.watch(cssSourceFiles, function(){
gulp.run('myth');
});
});
// Default Task
gulp.task('default', function(){
gulp.run('myth');
});
And when I execute gulp
, it runs all tasks consecutively:
$ gulp
[gulp] Using file /Volumes/CaseFS/wetopo/tool/Gulpfile.js
[gulp] Working directory changed to /Volumes/CaseFS/wetopo/tool
[gulp] Running 'myth'...
[gulp] Finished 'myth' in 2.85 ms
[gulp] Running 'watch'...
[gulp] Finished 'watch' in 4.33 ms
[gulp] Running 'default'...
[gulp] Running 'myth'...
[gulp] Finished 'myth' in 462 μs
[gulp] Finished 'default' in 1.25 ms
If I remove the default
task, it just runs myth
and watch
consecutively, and does not error.