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(plugins): add support for loading ESM plugins #2688
Conversation
Co-authored-by: Matt Travi <programmer@travi.org>
if (isFunction(name)) { | ||
return name; | ||
} | ||
|
||
return name; | ||
const file = resolveFrom.silent(basePath, name) || resolveFrom(cwd, name); | ||
const { default: cjsExport, ...esmNamedExports } = await import(`file://${file}`); | ||
|
||
if (cjsExport) { | ||
return cjsExport; | ||
} | ||
|
||
return esmNamedExports; |
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.
this implementation has changed slightly because of merging it with the fix for windows support of v20
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.
code changes look good to me 👍🏼
we're still having some trouble with our test suite completing successfully, especially in node v19. i dont believe the changes in this PR impact that situation and I would want to address that separately anyway, once we can figure out the root cause. short of understanding that, i'm going to go ahead and merge this change since we have successful verification from the parts that completed. |
🎉 This PR is included in version 20.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 21.0.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
this cherry-picks commits that originally landed in the current beta branch in order to backport the esm plugin loading capability into the mainline ahead of the beta branch landing.