0

I have next structure.

    html5
     |_33
       |_2.2.0
         |_js
           |_file1.js
           |_file2.js
           |_file3.js
     |_22
       |_2.2.0
         |_js
           |_file1.js
           |_file2.js
           |_file3.js
     |_24
       |_2.2.0
         |_js
           |_file1.js
           |_file2.js
           |_file3.js
    html5prod
     |_33
       |_2.2.0
         |_js
           |_file1(minify).js
           |_file2(minify).js
           |_file3(minify).js

From folder html5 I want move minified files in html5prod.

If its one folder I can write

gulp.task('scripts', function() {
   return gulp.src('./html5/**/*.js')
       .pipe(uglify())
       .pipe(concat('min.js', {newLine: ';'}))
       .pipe(gulp.dest('./html5prod/24/2.2.0/js'));
});

How write destination for all folders in this string?

.pipe(gulp.dest('./html5prod/24/2.2.0/js'));

Result will be next, from folder html5 > 24 go in html5prod > 24, from html5 > 33 go in html5prod > 33

SergeyB
  • 195
  • 1
  • 2
  • 10
  • Possible duplicate of [How do I copy directories recursively with gulp?](http://stackoverflow.com/questions/25038014/how-do-i-copy-directories-recursively-with-gulp) – Sven Schoenung Jan 16 '17 at 09:57
  • Possible duplicate of [Iterating over directories with Gulp?](http://stackoverflow.com/questions/22149966/iterating-over-directories-with-gulp) – mohamed-ibrahim Jan 16 '17 at 10:19

1 Answers1

0

Check this recipe from gulp docs here

it get all folders and start iterate over folders and direct the resulted scripts to destination.

mohamed-ibrahim
  • 9,510
  • 3
  • 35
  • 47