title: How to run a task ONLY on modified file with Gulp watch
body: <p>I have the current gulp task which I use in a gulpfile. Path are from a config.json and everything works perfectly:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>//Some more code and vars...
  
  gulp.task('watch', function() {
      gulp.watch([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], ['imagemin-cfg']);
  })
  
  //Some more code ...
  
  gulp.task('imagemin-cfg', function () {
      return gulp.src([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], {read: false})
          .pipe(imagemin({
              progressive: true,
              svgoPlugins: [{removeViewBox: false}],
              use: [pngcrush()]
          }))
          .pipe(gulp.dest(buildType))
          .pipe(connect.reload());
  });
  </code></pre>
  
  <p>But I still have an issue, the number of images in my project is huge and this task takes ages. I'm looking for a way to run my task ONLY on modified files. If I had an image or modify it, <code>imagemin()</code> will only run on this image, and not on all.</p>
  
  <p>Once again everything is working perfectly fine, but the run time is really long.</p>
  
  <p>Thanks.</p>