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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add
require.context
support #822feat: add
require.context
support #822Changes from 40 commits
d37ca65
faf5df7
87bf0af
0d59e7f
5852acb
12fcb4c
360ee19
f9a84b0
7b78806
1b807f3
797a92c
6f795ac
0cd6a1f
b8336fd
645443b
6e25851
ec0ac71
2b59675
182b4e8
2baf25d
5f110e6
063e99a
4b965fb
56c6a66
9d469a5
b88384a
c66d112
7e4308e
0795f6c
ec46ce0
2550dc8
d96a3bc
e05634f
a7dd372
7600f9e
6bf2b5a
4aae435
2172d42
612562c
6404eb0
6833b44
49b97a3
fbaf8bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment:
filePath.startsWith('..')
assumes normalisation, which seems to be safe in practice but I can't see it explicitly mentioned in the Node JS docs forrelative
(as it is forjoin
, for example).I wondered about the necessity of the
isAbsolute
check too, given we've obtained this path usingrelative()
, but I guess that's for Windows, eg for two files on different drives?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isAbsolute check appears to be extraneous now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure normalization is required for the the
..
check to work as this paradigm is cross-platform.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not normalised it might not appear at the start of the path - eg
foo/../../bar
is valid but normalises to../bar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still necessary for Windows tbh, looks like we get absolute paths back when there's no valid relative path between locations: