Answer the question
In order to leave comments, you need to log in
What is the difference between gulp.src() and vinyl-source-stream + vinyl-buffer?
In Gulp, you need conditional processing, for example, if there is a 'min' argument, then skip styles through CSSO, if not, then process further. I use ternary operators because I don’t want to hang more plugins like gulp-if, so I need a plug function to do this, I
.pipe(argv.min ? csso() : затычка())
see two plug options and both work if the stream already exists
function затычка() {
return gulp.src('neverUsedName', {
allowEmpty: true
})
}
import buffer from 'vinyl-buffer'
import source from 'vinyl-source-stream'
function затычка() {
return source('fake-name')
.pipe(buffer())
}
function example() {
// какие то действия
return затычка()
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question