在不使用.pipe()的情况下调用gulp-notify [英] Calling gulp-notify without using .pipe()

查看:130
本文介绍了在不使用.pipe()的情况下调用gulp-notify的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 gulpfile.js 中,我有一个调用两个其他任务的任务。当以前的任务已经运行时,应该触发通知。

In my gulpfile.js I have a task that calls two other tasks. When the previous tasks have run, a notification should be triggered.

var notify = require('gulp-notify');

gulp.task('build', ['build:js', 'build:css'], function() {
  console.log('hello', arguments);
  gulp.src('gulpfile.js').pipe( notify({ title: 'Production Build', message: 'Done' }) );
});

有没有办法在不调用 gulp.src('gulpfile .js')。pipe( first?虽然不是一个真正的问题,但这种方法对我来说是没有必要的,我的问题完全可能是由于对gulp的理解不足造成的。任何误解。

Is there a way to trigger notify without calling gulp.src('gulpfile.js').pipe( first? While not a real problem, this approach feels unnecessary to me. It is entirely possible that my question results from an insufficient understanding of gulp. So feel free to point me to any misunderstanding.

推荐答案

您可以使用

You can use node-notifier directly:

var notifier = require('node-notifier');

gulp.task('build', ['build:js', 'build:css'], function() {
    notifier.notify({ title: 'Production Build', message: 'Done' });
});

这篇关于在不使用.pipe()的情况下调用gulp-notify的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆