Closed slaskis closed 12 years ago
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.
node_modules/
lib/
Here's an example using TJs emitter-component:
// 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:
emitter-component/index.js
> npm i emitter-component > make
It's also backwards compatible, so no harm done!
I really enjoy browserbuild though, so neat and tidy. Thanks!
This is really cool
thanks :)
The reason I'd like to be able to do this is really just to be able to use
node_modules/
andlib/
as my basepaths. Because this way I can keep my library nicely separated into module.Here's an example using TJs emitter-component:
So now, instead of having to download the
emitter-component/index.js
and add it to the repo we simply do this:It's also backwards compatible, so no harm done!
I really enjoy browserbuild though, so neat and tidy. Thanks!