I have a large list of images (2874) that I need to optimize with gulp-imagemin, but the OS seems to limit the number of open files. I can change this with ulimit, but it does not feel particularly portable and secure, given the number of files.
This is my current code:
function optimizeImages() {
return gulp.src('images/*')
.pipe(imagemin())
.pipe(gulp.dest(dest));
}
Is there a way to run a plugin on a subset of files at the same time? Like this
function exampleTask() {
return gulp.src('images/*')
.pipe(limitConcurrency(imagemin(), 50))
.pipe(gulp.dest(dest));
}
source
share