1

I have such JSON

[
  {"replacement": "str1", "destination": "dir1"},
  {"replacement": "str2", "destination": "dir2"},
  {"replacement": "str3", "destination": "dir3"},
  {"replacement": "str4", "destination": "dir4"}
]

and quite simple gulp task

var replace = require('gulp-replace');

gulp.task('mytask', function() {
  return gulp.src('myfile.txt')
    .pipe(replace(/foo(.{3})/g, replacement))  // take `replacement` from json
    .pipe(gulp.dest(destination));             // take `destination` from json
});

I need run this stuff in loop. I need either call this task from the default task several times with different params or implement loop inside the mytask task.

Taras Hupalo
  • 1,337
  • 2
  • 16
  • 29

0 Answers0