I'm using gulp-plumber + gulp-notify and want to put task name in gulp-notify as a title. following is the code i wrote, thanks in advance.
gulp.task('SOMETASK', function() { return gulp.src(sourcePaths) .pipe(plumber({errorHandler: notify.onError({ message: "<%= error.message %>", title: "I WANT TO PUT TASK NAME HERE" })})) // omitted below });
src() # The gulp. src() function takes a glob (i.e. a string matching one or more files) or an array of globs and returns a stream that can be piped to plugins. Gulp uses node-glob to get the files from the glob or globs you specify.
Gulp purely uses the JavaScript code and helps to run front-end tasks and large-scale web applications. It builds system automated tasks like CSS and HTML minification, concatenating library files, and compiling the SASS files.
gulp.Gulp.prototype.__runTask = gulp.Gulp.prototype._runTask; gulp.Gulp.prototype._runTask = function(task) { this.currentTask = task; this.__runTask(task); } gulp.task("someTask", function(){ console.log( this.currentTask.name ); }
gulp.task('SOMETASK',function() { console.log('Task name:', this.seq.slice(-1)[0]) // Task name: SOMETASK })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With