LearnBoost/browserbuild — pull request #19 by slaskis (2012-05-30 09:57:30+00:00)
Title: Multiple basepaths, separated by a comma.

The reason I'd like to be able to do this is really just to be able to use `node_modules/` _and_ `lib/` as my basepaths. Because this way I can keep my library nicely separated into module.

Here's an example using TJs [emitter-component](https://github.com/component/emitter):

```
// lib/epic.js

var Emitter = require('emitter-component');

function Epic(){
Emitter.call(this);
this.rowdy = false;
}

Epic.prototype = new Emitter;

Epic.prototype.thing = function(){
if( this.rowdy )
this.emit('AAAAH!');
else
this.emit('aaaah');
}

```

```
// Makefile

LIBS = lib/epic.js /
node_modules/emitter-component/index.js

all: epic.min.js
@:

epic.js: $(LIBS)
node_modules/.bin/browserbuild -b lib/,node_modules/ -m epic $(LIBS) > $@

epic.min.js: epic.js
node_modules/.bin/uglifyjs < $< > $@

```

So now, instead of having to download the `emitter-component/index.js` and add it to the repo we simply do this:

```
> npm i emitter-component
> make
```

It's also backwards compatible, so no harm done!

I really enjoy browserbuild though, so neat and tidy. Thanks!