Properly handle upper directories as external dependencies #4419
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 PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #4349
Description
There is a logic in Rollup that prevents using
..
or.
to import a chunk that corresponds to a parent directory of another chunk. While this makes sense for chunks, it fails for external dependencies, resulting in #4349.This PR does two things:
.
,..
,../..
etc. I know this might be controversial as this is "correct" in CommonJS but not supported in true ESM engines. Feedback welcome. The alternative would be to add even more../
to the import, i.e...
might become../../foo
. This would also add the parent directory name to the import, which may actually not be what is intended if the original external import was..
.../..
as well (and directories even further up).