Skip to content
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

use nextLoad().format rather than context.format #224

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

iambumblehead
Copy link
Owner

@iambumblehead iambumblehead commented Aug 7, 2023

re #224 context.format is not always defined and nextLoad().format is always defined and using nextLoad().format allows the test to pass

@iambumblehead
Copy link
Owner Author

at least one test needs to be added but I believe this PR has the solution

@koshic
Copy link
Collaborator

koshic commented Aug 7, 2023

at least one test needs to be added but I believe this PR has the solution

Yep, it looks like a good solution - next loaders (or default loader) must provide format on their 'load' hook. Only one [rare] case probably not covered - when some loader added into the chain after esmock, format returned from that loader will be ignored.

@iambumblehead
Copy link
Owner Author

@koshic thanks

@iambumblehead iambumblehead merged commit fd4b0e3 into master Aug 7, 2023
8 checks passed
@iambumblehead iambumblehead deleted the resolve-218-import-key-cjs-modules branch August 7, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants