Closed AlistairB closed 10 years ago
gulp-if
does ternaries, so this works for me:
gulp.task('sprites', function () {
return gulp.src('./src/img/*.png')
.pipe(sprite({
name: 'sprite.png',
style: '_sprite.scss',
cssPath: './img',
processor: 'scss'
}))
.pipe(gulpif('*.png', gulp.dest('./dist/img/'), gulp.dest('./dist/scss/')))
});
i.e. if it's a png output to images, otherwise assume it's the scss.
Ah right, this works. Thanks a lot!
Thanks @paulwib. I updated the readme with your example.
Hi,
The gulp example
is problematic. I don't claim to fully understand what was happening, but this is my take on the issues it was causing.
Not sure exactly why but this causes a write after end error
My solution was to simply output using style: '/dist/scss/_sprite.scss' and only have one gulp.dest.
Not sure exactly what needs to happen, but I think this is at least an issue with the example.