Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between watchify and gulp.watch

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?

like image 596
Flake Avatar asked Feb 21 '16 18:02

Flake


1 Answers

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.

like image 197
Prinzhorn Avatar answered Sep 22 '22 08:09

Prinzhorn