browserify / watchify

watch mode for browserify builds
Other
1.79k stars 181 forks source link

repeated incremental builds take longer and longer #192

Closed mmmurf closed 9 years ago

mmmurf commented 9 years ago

my config is below... the initial bundle takes around 5000 ms, then the next one takes 800, then it creeps up to 1000, 1200, 1500, 18000, 3000, etc. etc. This is just adding/removing a single character from one of the source files.

Using iojs v1.6.4

function bundle(b){
  b.transform(babelify)
   .bundle()
   .pipe(fs.createWriteStream("public/bundle.js"))
}

var b = browserify({
  cache: {},
  packageCache: {},
  fullPaths: true,
  debug: true
});

b = watchify(b);
b.add("./scripts/index.jsx");
bundle(b);

gulp.task("scripts", function(){

  b.on('update', function(args){
    bundle(b);
  });

  b.on('time', function (time) {
    console.log("optimized bundle took: " + time + "ms");
  });
});
mmmurf commented 9 years ago

Oops, just looked through previous issues and found https://github.com/substack/watchify/issues/187

I had the same config problem. Now fixed.