Resolve pathnames of exposed modules more efficiently. #1077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a followup to #1059. After I submitted that, I was working on an async version, which I didn't have ready yet when you pushed your async implementation, @substack. Then I realized that I don't think it's necessary to even do the resolution in browserify, because it looks like module-deps already does it, before anything else needs access to it.
This changeset relies on related changes to module-deps (browserify/module-deps/pull/65).
This may have some rough edges that need to be smoothed out.
Whereas this works:
In the former case it leads module-deps to mark the file as builtin which causes transforms not to be run on it. I didn't know that, because tests were passing. I didn't discover it until debugging #1074. One solution would be to set a different prop on the object in
b.require()
, e.g.exposeAs
instead ofexpose
, but that seems kind of silly. I haven't had the chance to do it yet, but I think it would be good to take a closer look at how module-deps is handling that scenario and see if there isn't a correction needed there.