Supply package from which module was resolved to callback. #21

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@jaredhanson
Contributor

This patch will adds an opts.package options, which the caller sets to the package metadata of the package which the module is being resolved from. The callback takes a third (optional) argument which is the package metadata of the package from which the resolved module was found in.

For modules in the same package, this will be identical to the opts.package option passed in. If the module was loaded from a different package, it will be different, obviously.

This is part of a larger set of forthcoming patches that is ultimately designed to address the following issues:

substack/module-deps#7
substack/module-deps#13

Also, I only implemented this for the async resolve. It didn't seem useful to return an array from the sync resolve just to pass an optional package, and browser-resolve and module-deps don't use the sync version anyway.

I will update this PR with the other relevant PRs as I submit them. Cheers!

@substack
Owner
substack commented Jun 9, 2013

Published as 0.4.0. Thanks!

@substack substack closed this Jun 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment