Answer the question
In order to leave comments, you need to log in
Filter by file size?
Perhaps the question is stupid, I started working with gulp recently.
gulp.task('bla', function () {
return gulp.src('src/images/*')
/*Проверка размера файла. Больше 10кб - игнорируются*/
.pipe(gulp.dest('build/images'));
});
return gulp.src('.src/images/*')
), it is necessary that it processes files larger than the specified size (10kb) and copies them to ( .pipe(gulp.dest('build/images'));
), and skips smaller files (NOT copied).
Answer the question
In order to leave comments, you need to log in
With gulp-custom-filter :
var gulp = require('gulp');
var filter = require('gulp-custom-filter');
gulp.task('test', function() {
return gulp.src('src/images/*')
.pipe(filter(function (file) { return file.stat.size > 10 * 1024; }))
.pipe(gulp.dest('build/images'));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question