Calling gulp-notify without using .pipe()(在不使用 .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(
的情况下触发通知?虽然不是一个真正的问题,但这种方法对我来说没有必要.完全是可能我的问题是由于对 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.
推荐答案
可以直接使用node-notifier:
var notifier = require('node-notifier');
gulp.task('build', ['build:js', 'build:css'], function() {
notifier.notify({ title: 'Production Build', message: 'Done' });
});
这篇关于在不使用 .pipe() 的情况下调用 gulp-notify的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在不使用 .pipe() 的情况下调用 gulp-notify


基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01