-
-
Notifications
You must be signed in to change notification settings - Fork 927
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
Add support for ESM custom syntaxes #7351
Conversation
🦋 Changeset detectedLatest commit: ab38fa2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
} catch (error) { | ||
if ( | ||
error && | ||
typeof error === 'object' && | ||
'code' in error && | ||
error.code === 'MODULE_NOT_FOUND' && | ||
(error.code === 'MODULE_NOT_FOUND' || error.code === 'ERR_MODULE_NOT_FOUND') && |
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.
[note] The path of error.code === 'ERR_MODULE_NOT_FOUND'
is not covered in tests for some reason. I guess Babel under Jest may transform the import()
code, but I'm not sure.
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.
Nice work! LGTM, thank you.
Closes #7269
The dynamic
import()
supports both ESM and CJS.