substack/node-browserify — Issue #88: Remove generated "base" require code from generated file - Create browserify.js
Author: viatropos
Created: 2011-11-01 00:49:20+00:00
State: open

I would like to break my files into chunks and when I run it through the browserify command it adds this to each chunk!

- https://gist.github.com/1329534

That type of thing should be placed into an external library. If it's an external library, I get the following benefits:

1. A standard lib that can be minified, gzipped, and even cached on something like http://code.google.com/apis/libraries/.
2. A clean wrapper for each bundle, which would just look like:

``` javascript
require.define("aModule", function (require, module, exports, __dirname, __filename) {

});
require("aModule");
// maybe some others
```

instead of https://gist.github.com/1329534.

I feel like this must be in here as a configuration option somewhere, maybe I've missed something. Any suggestions? Can this be added fairly easily if it doesn't already exist? Something like a simple command line argument:

```
browserify --bare ./lib/aModule.js -o ./dist/aModule.js
```

I'm down to submit a patch if this makes sense. Thanks for your help.