I'm pretty new on Gulp, Watchify and browserify, so I borrowed this code from someone's blog:
function browserifyShare(){
var b = browserify({
cache: {},
packageCache: {},
fullPaths: true
});
if(watch) {
// if watch is enable, wrap this bundle inside watchify
b = watchify(b);
b.on('update', function(){
bundleShare(b);
});
}
b.add('./views/js/lib/http.js');
b.add('./views/js/lib/webSocket.js');
b.add('./views/js/home.js');
bundleShare(b);
}
The problem is that I have to use b.add() to watch over a new file. What if I have numerous files under the same directory and I want to watch over all of them? I tried js/lib/*.js but it didn't work.
I'm pretty new on Gulp, Watchify and browserify, so I borrowed this code from someone's blog:
The problem is that I have to use
b.add()
to watch over a new file. What if I have numerous files under the same directory and I want to watch over all of them? I triedjs/lib/*.js
but it didn't work.