Answer the question
In order to leave comments, you need to log in
How to concatenate files with the same name using Gulp?
As an example, we have the following directory with JSON files:
test/
dir1/
test.json
test2.json
dir2/
test.json
test2.json
test.json
and, test2.json
accordingly. gulp-foreachand
gulp-merge-jsonI came up with this one:
return gulp.src('test/**/*.json')
.pipe(foreach((stream, file) => {
return stream
.pipe(merge(`${path.basename(file.path)}`));
}))
.pipe(gulp.dest(`куданибудь/`));
dir2
.
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