jmreidy/grunt-browserify — pull request #39 by wilsonpage (2013-05-06 09:42:34+00:00)
Title: Added functionality for b.require(<file>)

[b.require()](https://github.com/substack/node-browserify#brequirefile-opts) exposes a package so that it can be required outside of the bundle. This is useful when you need to stub/mock dependencies during testing.

I have built this into `grunt-browserify` so that it can be used like so:

```js
browserify: {
testable: {
src: ['lib/index.js'],
dest: 'build/build-test.js',
options: {
require: [
'event',
'./lib/*/*.js'
]
}
}
}
```

Enabling:

```js
window.require('event');
window.require('./lib/dir/file1.js');
window.require('./lib/dir/file2.js');
```