Answer the question
In order to leave comments, you need to log in
How to write a task for gulp to copy pictures into one folder?
I'm trying to make a project using the BEM methodology.
There is a blocks directory with subdirectories containing the corresponding files for each block, including pictures.
Please tell me how can I write such a task for gulp -
so that all the pictures from these folders are copied to the dist/images folder.
I tried to do it just by copying, but the pictures are copied along with their folder in which they are located, how to make sure that only pictures are copied.
gulp.task('images', function() {
return gulp.src('blocks/**/*+(.jpg|png|gif|svg)')
.pipe(gulp.dest('dist/images') )
});
thanks for answers
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