Answer the question
In order to leave comments, you need to log in
Gulp rename - how to rename all files and folders in order?
Project structure:
Config:
var gulp = require('gulp');
var imageResize = require('gulp-image-resize');
var rename = require('gulp-rename');
var resizeImageTasks = [];
[100,300].forEach(function(size) {
var resizeImageTask = 'resize_' + size;
gulp.task(resizeImageTask, function() {
return gulp.src('src/**/*.{jpg,png,tiff}')
.pipe(imageResize({
width: size,
height: size,
upscale: false
}))
.pipe(gulp.dest('dist/' + size + '/'));
});
resizeImageTasks.push(resizeImageTask);
});
gulp.task('resize_all', resizeImageTasks);
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