Browserify

Browserify was the first module bundler and it changed the way frontend code was written. Browserify will analyze and follow the require calls from an entry point JavaScript file, build up a list of dependencies, download them, and then bundle everything into a single JavaScript file that can be injected using a single <script> tag. The modules are added recursively, meaning the innermost dependencies are added first. This ensures modules are bundled in the correct order.

To use it, you simply install the browserify package, and specify the entry point of your application as well as the location where you want the bundle to be placed.

$ npm install -g browserify$ browserify entry.js > bundle.js

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.