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-deps
to fix that problem. But I am not sure if it's the right way.The
rows
generated bymodule-deps
should contain a dependency graph with the keyid
(identifying a node in the graph), yetrow.deps
are resolved to absolute file paths, rather than theid
s of the corresponding dependent rows, which means we may not find some dependent row from thedeps
property.The rows generated by module-deps should contain a dependency graph with the key
id(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.js
is{"./foo":"/Users/zoubin/usr/src/zoubin/module-deps/example/files/foo.js"}
. It is impossible to retrieve thefoo.js
row from the output rows. And that is why I got anundefined
deps in browserify/browserify#1260