A
A
Andrey Kvartsov2018-02-08 10:00:00
JavaScript
Andrey Kvartsov, 2018-02-08 10:00:00

How to collect images not in a directory using Gulp?

Good afternoon.
In the project, I collect pictures like this:

gulp.task('img', function () {
    gulp.src('app/html/**/img/**.*')
        .pipe(gulp.dest(''build/img'));
});

Pictures are in different directories next to the blocks where they are used:
app/html/blockName/img/imgName.jpg
app/html/blockName2/img/imgName.jpg
Etc.
But when building to the build / img directory, I get pictures in the directories as before the assembly, that is:
build / img / blockName / img / imgName.jpg
How to redo the task so that all the pictures are collected immediately in the
build / img directory without additional directories

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question