Prevent gulp watch from going through third party scripts

Hi! I am including a lot of scripts through this code in manifest.json:

"plugins.js": {
  "vendor": [
    "assets/scripts/plugins/*.js"
  ]
}

It works, but it also always re-compiles the scripts, if I save my main.js file on gulp watch. This takes then around 30 seconds every time and prevents me from being productive. The solution would be to only recompile the plugins.js task if I actually changed something in the folder “plugins”. Can anyone point me in the right direction?

For now I edited the gulpfile as follows: I added a new scripts task after the default one and called it “scripts-only-main”:

gulp.task('scripts-only-main', ['jshint'], function() {
  var merged = merge();
  console.log( merged );
  manifest.forEachDependency('js', function(dep) {
    if( "main.js" === dep.name ) {
      merged.add(
        gulp.src(dep.globs, {base: 'scripts'})
          .pipe(jsTasks(dep.name))
      );
    }
  });
  return merged
    .pipe(writeToManifest('scripts'));
});

and called if from the watch task:

gulp.watch([path.source + 'scripts/main.js'], ['jshint','scripts-only-main']);

So now the script only updates the main.js file if I rund gulp watch.

I am going to implement incremental builds that will solve this:

Thanks @austin, and also thanks for making this huge effort! If you ever come to berlin, you are invited to have a beer (or many) with me :sunny: