Express/Connect middleware for Browserify v2, currently at version 8.1.1. Provides sensible defaults: automatic source maps, file watching in development, minification, gzip, and etag caching in production. Supports serving individual files, directories of files, and npm package bundles with external dependencies for optimized caching. Allows use without Express except for directory serving. Last updated in 2013; depends on browserify >=2.x and uses uglify-js. Compared to alternatives like budo or watchify, it integrates directly as middleware for existing Express apps.
npm install browserify-middlewareVerified import paths — ran on the pinned version, not inferred.
Sets up an Express server that serves a browserified version of client/main.js at /js/bundle.js.
Consider migrating to modern bundler middleware like budo or webpack-dev-middleware.
Use __dirname to construct absolute paths: browserify(__dirname + '/client/dir')
Use the array form only for shared dependencies; use .external option for external referencing.
npm install browserify --save
Use: var browserify = require('browserify-middleware');browserify(['module-a', 'module-b']) not browserify('module-a', 'module-b')