title: Gulp Browserify takes longer to compile on each save/change
body: <p>I'm trying to speed up my Gulp workflow, using Browserify. I'm following this blog post:
  <a href="http://christianalfoni.github.io/javascript/2014/08/15/react-js-workflow.html" rel="nofollow">http://christianalfoni.github.io/javascript/2014/08/15/react-js-workflow.html</a></p>
  
  <p>I have everything working, and changes are initially quite quick (500ms or so).</p>
  
  <p>However, this time increases each time I save a file. My task:</p>
  
  <pre><code>gulp.task('browserify', function() {
  
  var bundler = browserify({
      entries: ['./src/js/app.js'],
      debug: production,
      cache: {},
      packageCache: {},
      fullPaths: true
  });
  
  var watcher = watchify(bundler);
  
  return watcher
      .on('update', function() {
  
          var updateStart = Date.now();
  
          function transform(next) {
            console.log('JavaScript changed - recomiling via Browserify');
            watcher.transform(babelify).bundle()
            .pipe(source('bundle.js'))
            .pipe(gulp.dest('./build/scripts'))
            .on('end', next);
          }
  
          transform(function() {
            gulp.start('usemin');
            console.log('Complete!', (Date.now() - updateStart) + 'ms');
          });
  
      })
      .transform(babelify)
      .bundle()
      .pipe(source('bundle.js'))
      .pipe(gulp.dest('./build/scripts'));
  </code></pre>
  
  <p>So on first build, it takes around 3 seconds (and that's including one file).</p>
  
  <p>Then, on file change:</p>
  
  <pre><code>JavaScript changed - recomiling via Browserify
  [11:31:24] Starting 'usemin'...
  Complete! 608ms
  [11:31:24] Finished 'usemin' after 24 ms
  JavaScript changed - recomiling via Browserify
  [11:31:29] Starting 'usemin'...
  Complete! 785ms
  [11:31:29] Finished 'usemin' after 26 ms
  JavaScript changed - recomiling via Browserify
  [11:31:31] Starting 'usemin'...
  Complete! 814ms
  [11:31:31] Finished 'usemin' after 17 ms
  JavaScript changed - recomiling via Browserify
  [11:31:33] Starting 'usemin'...
  Complete! 1112ms
  [11:31:33] Finished 'usemin' after 17 ms
  JavaScript changed - recomiling via Browserify
  [11:31:36] Starting 'usemin'...
  Complete! 1594ms
  [11:31:36] Finished 'usemin' after 16 ms
  </code></pre>
  
  <p>I'm not actually changing the file, just saving it over and over. Is something stacking up here which I'm missing?</p>
  
  <p>EDIT:</p>
  
  <p>It turns out removing <code>.transform(babelify)</code> from the 'update' removes this issue. Not sure what issues this might cause down the line though... or why that makes it take ages.</p>