substack/browser-pack — pull request #9 by epeli (2013-03-23 17:36:50+00:00)
Title: Save previous requires and recurse to them on require

Ok, another take on https://github.com/substack/node-browserify/issues/341

This pull request is not be merged directly because some of the tests fail, but it should present the idea for now.

With this it shouldn't matter in which order multiple bundles are added
to the dom. If local require fails to find the module from its map it
jumps the to current root require in the global scope and works its way
back down from there.

This also require a change to browserify. All bundles should always write the global require. Not just the ones build with `--require`.