Closed azer closed 9 years ago
I have similar issues with watchify these days.
If you're hitting the same error with me, try listening the update method and generating the bundle on that event. here is full working example:
var browserify = require("browserify");
var watchify = require("watchify");
var fs = require("fs");
var b = browserify({ cache: {}, packageCache: {} });
var w = watchify(b);
w.add('index.js');
w.on('update', function () {
w.bundle().pipe(fs.createWriteStream('output.js'));
});
This is how watchify has worked for a long time.
Looks like API has been changed recently, and I can't get a simple example working. Here is the code I'm trying;
Browserify: 11.2.0 Watchify: 3.4.0
When I run it, it keeps running but does nothing when I change the files. Any ideas what I'm missing ?