I have just started using Browserify
with gulp
and I came across examples using watchify
.
What I don't understand is that why not use gulp.watch
instead?
What is the difference between watchify
and gulp.watch
?
watchify
understands commonjs modules (require(./foo.js)
stuff) and will watch for changes for all dependencies. It can then recompile the bundle with the changes needed and only reload the changed files from disk. If you use gulp.watch
and manually call browserify, it has to build up the dependency tree every time a change happens. This means a lot more disk i/o and hence it will be much slower.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With