resolve deps to row.id rather than row.file #88
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.
I encountered the problem in browserify/browserify#1260
I think there is something can be done in
module-depsto fix that problem. But I am not sure if it's the right way.The
rowsgenerated bymodule-depsshould contain a dependency graph with the keyid(identifying a node in the graph), yetrow.depsare resolved to absolute file paths, rather than theids of the corresponding dependent rows, which means we may not find some dependent row from thedepsproperty.The rows generated by module-deps should contain a dependency graph with the keyid(identifying a node in the graph). I am sorry to bother, if I misunderstand the deps output.Here is an example (with some twists to https://github.com/substack/module-deps/blob/master/example/deps.js):
The output is:
The deps of
main.jsis{"./foo":"/Users/zoubin/usr/src/zoubin/module-deps/example/files/foo.js"}. It is impossible to retrieve thefoo.jsrow from the output rows. And that is why I got anundefineddeps in browserify/browserify#1260