本文介紹了在不使用 .pipe() 的情況下調用 gulp-notify的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
在我的 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!