Gulp gulp-util provides logging and was created by the Gulp team.
var gutil = require('gulp-util'); gutil.log('Hello world!');
To add a log, Gulp API documentation let us know .src returns:
Returns a stream of vinyl files that can be connected to plugins.
Node.js Stream documentation contains a list of events. Let's compare an example here:
gulp.task('default', function() { return gulp.src('main.scss') .pipe(sass({ style: 'expanded' })) .on('end', function(){ gutil.log('Almost there...'); }) .pipe(minifycss()) .on('end', function(){ gutil.log('Done!'); }); });
Note. The end event can be triggered before the plugin completes (and sends all its own output), because the event is fired when "all data has been flushed to the base system."
Jacob Budin Jan 16 2018-01-15T00: 00Z
source share