O
O
Olga Zhizhka2015-10-21 01:58:55
gulp.js
Olga Zhizhka, 2015-10-21 01:58:55

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

1 answer(s)
A
Aves, 2015-10-21
@Helga_Zhizhka

gulp-flatten , but of files with the same name, only the last one will remain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question