Properly resolve absolute path of exposed module. #1059
Closed
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.
The change in #1033 is flawed. And the test coverage for requires is inadequate.
See #1039 (part 1). A broken bundle is generated when doing something like...
...because the code in #1033 essentially does...
...which leads to a mismatch here...
https://github.com/substack/deps-sort/blob/c61e515015a0f8392c1b07530877084b6c411cb7/index.js#L72
...because there should be an entry
index['/somedir/src/b.js']
, but instead there'sindex['/somedir/src/b']
.I'm not 100% sure this pull request completely and correctly solves the problem for all cases, but it does solve it for the scenario in #1039 and is a step in the right direction. That this apparently used to work (according to @gasi in #1033) and that #1033 was merged as a fix underscores the need for better and more comprehensive tests around this functionality.