talira

Browserify

Use Node-style require() in the browser by bundling your dependencies

open sourceMITfree

Browserify lets browser code use a Node-style require() and modules installed from npm. It follows every require() call in an app, using Node's module lookup algorithm, and builds one bundle to serve in a single script tag. It runs from the command line or through its Node API, supports transforms and plugins, can produce standalone UMD bundles and source maps, and shims many Node core modules for the browser. It was created by James Halliday.

Problems it solves

  • use npm packages and require() in browser JavaScript
  • bundle my CommonJS modules into one script for the browser
  • build a single JS file from a Node-style codebase for a web page

Features

  • bundles CommonJS require() calls into one browser script
  • resolves npm packages with Node's module lookup
  • transforms and plugins
  • standalone UMD bundles
  • source maps with --debug
  • browser shims for Node core modules

Alternatives

The same job

These do what Browserify does.

  1. webpack A bundler for javascript and friends
  2. esbuild An extremely fast bundler for the web
  3. Rollup ES module bundler for JavaScript libraries and apps, with tree shaking
  4. webpack-node-externals Exclude node_modules from webpack bundles for the backend

Compare Browserify with the top 3