Jump to root require if module is not found from the local map #9

Merged
merged 1 commit into from Mar 24, 2013

Projects

None yet

2 participants

@epeli
Contributor
epeli commented Mar 23, 2013

Ok, another take on substack/node-browserify#341

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.

Example usage https://github.com/epeli/lazy-browserify/blob/master/both.js

@epeli epeli Jump to root require if not found.
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.

Should fix substack/node-browserify#341
2c68dcb
@epeli
Contributor
epeli commented Mar 24, 2013

I've updated the pull request. It's now simpler and all tests pass on browser-pack and browserify modules.

@substack
Owner

With this patch head.js can natively load browserify bundles? If so that is really impressive.

@epeli
Contributor
epeli commented Mar 24, 2013

Yes :) or with any script loader

@substack substack merged commit 2c68dcb into substack:master Mar 24, 2013
@epeli epeli referenced this pull request in substack/node-browserify Mar 25, 2013
Closed

Cannot lazy load multiple bundles #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment