But a cool thing I didn’t mention about Browserify the tool (as opposed to its module system) is the availability of numerous filters.
Since not everyone has been persuaded by the wisdom of CommonJS yet, some useful libs are still built to the AMD module standard. The deamdify transform automatically wraps AMD modules to work with Browserify. You don’t even have to list which modules are AMD — it just figures that out.
What about libraries that just attach to the global object (
Surprisingly, there’s a
deglobalify transform to
address that too. Deglobalify does need a little bit of configuration:
require a second argument, an array of stuff exported onto
the window object. Also, it doesn’t let you specify dependencies the
library looks for. But it’s still useful for simple cases; otherwise,
you can write a shim.