admin管理员组文章数量:1326061
I want to make voice control/feedback/response for my build in gulp. I wrote something like this below, but it is not working. Does anybody know how to fix it? :)
It throws this error.
// Compile Sass, autoprefix properties, generate CSS.
gulp.task('sass', function () {
return sass('src/sass/style.scss', {style: 'pressed'})
.pipe(autoprefixer())
.pipe(rename('style.css'))
.pipe(gulp.dest('src/css/'))
.pipe(gutil.beep()) // beep when build is done
})
I want to make voice control/feedback/response for my build in gulp. I wrote something like this below, but it is not working. Does anybody know how to fix it? :)
It throws this error.
// Compile Sass, autoprefix properties, generate CSS.
gulp.task('sass', function () {
return sass('src/sass/style.scss', {style: 'pressed'})
.pipe(autoprefixer())
.pipe(rename('style.css'))
.pipe(gulp.dest('src/css/'))
.pipe(gutil.beep()) // beep when build is done
})
Share
Improve this question
edited May 19, 2017 at 18:58
Preview
35.8k10 gold badges95 silver badges113 bronze badges
asked Mar 27, 2015 at 12:30
tenhobitenhobi
2,0323 gold badges25 silver badges50 bronze badges
3
-
Does it work if you remove
.pipe(gutil.beep())
? – lsowen Commented Mar 27, 2015 at 12:33 - The build works, but I want 'beep' after the build will done. – tenhobi Commented Mar 27, 2015 at 12:38
-
1
What version of
gulp-util
do you have? According to this,beep()
was removed at some point. – lsowen Commented Mar 27, 2015 at 13:10
3 Answers
Reset to default 5Or just use
console.log('\x07');
As of now, gulp-util
has the beep
method. So you can add this to the end of your gulp workflow >> .on('end', function () { gutil.beep(); });
As @lsowen pointed out, gulp-util does not have the beep
function anymore, so you should
npm install --save-dev beepbeep
And do something like:
var beep = require('beepbeep');
gulp.task('sass', function () {
return sass('src/sass/style.scss', { style: 'pressed' })
.pipe(autoprefixer())
.pipe(rename('style.css'))
.pipe(gulp.dest('src/css/'))
.on('end', function () { beep(); });
});
本文标签: javascriptgulpBeep when doneStack Overflow
版权声明:本文标题:javascript - gulp - Beep when done - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742198014a2431439.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论