require()
is Node's way of loading/importing modules. When you run a Gulp task, it is being run by the Node runtime on your computer, so require()
is "natively" supported.
Browserify came later, and was inspired by this behaviour. As it says on Browserify's website:
Browsers don't have the require method defined, but Node.js does. With Browserify you can write code that uses require in the same way that you would use it in Node.
In other words, when your JavaScript runs in a browser, there's no Node to be found, so you can't use require()
. Browsers will complain that there's no such method. Browserify's solution is to let you write code with modules and require()
, but with an extra compilation step before it ever gets to the browser so that require()
works like it does in Node.
The "extra compilation step" involves working out what modules depend on others, and bundling your code in a way that facilitates certain modules to load other modules (with require()
) when they need to. Browserify then has its own require()
method that it makes available to browsers within your bundle, providing essentially the same functionality as Node's require()
.
This is a good article that explains how Browserify works.
So in some ways, to answer your question, there isn't that much difference that you need to worry about. The main practical difference is that Browserify needs an explicit compilation/build step to generate your output bundle whereas you don't need to think about that when running code with Node (and therefore Gulp).