Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚刚开始使用Browserifywithgulp并且遇到了使用watchify. 我不明白的是,为什么不使用gulp.watch呢?和 和 有什么不一样?watchifygulp.watch
Browserify
gulp
watchify
gulp.watch
watchify了解 commonjs 模块(require(./foo.js)东西)并将监视所有依赖项的更改。然后它可以使用所需的更改重新编译捆绑包,并且只从磁盘重新加载更改的文件。如果您使用gulp.watch并手动调用 browserify,则每次发生更改时都必须构建依赖关系树。这意味着更多的磁盘 i/o,因此速度会慢得多。
require(./foo.js)