On-demand browserify bundler middleware for development with watchify support. Version 2.0.0 is the latest stable release, with low release cadence (last release in 2016). It dynamically bundles CommonJS modules via HTTP requests, caching bundles with watchify for fast responses during development. Unlike manual watchify tasks or file-based bundling, it integrates directly as Express middleware, intercepting *.js requests and bundling on the fly. Not suitable for production—use browserify build process instead. Works with Node.js and Express.
npm install browserify-dev-bundlerVerified import paths — ran on the pinned version, not inferred.
Sets up an Express server with on-demand browserify bundling using the middleware.
Use a regex pattern to restrict which URLs are bundled: e.g., bundler.middleware(/^\/js\/(.+)\.js$/).
Set watchify: false if you don't need auto-rebundling, or manually manage watchify instances.
Update regex patterns if you relied on older defaults; use bundler.middleware(/^\/js\/(.+)\.js$/) to restrict paths.
Ensure addFile function uses bundle.require() with expose option for modules that need to be requireable by other bundles.
Always attach a listener to 'bundle-error' event: bundler.on('bundle-error', err => console.error(err)).Run: npm install browserify watchify --save-dev
Use: const bundler = new DevBundler(options); or simply DevBundler(options) (works without new due to internal check).