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 native esm to @babel/runtime #10748
Add support for native esm to @babel/runtime #10748
Conversation
eb4fe0c
to
ff7662c
Compare
rm -rf packages/babel-runtime-corejs2/helpers | ||
rm -f packages/babel-runtime/helpers/**/*.js | ||
rm -f packages/babel-runtime-corejs2/helpers/**/*.js | ||
rm -f packages/babel-runtime-corejs3/helpers/**/*.js | ||
rm -rf packages/babel-runtime-corejs2/core-js |
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.
nit: I think we should also clean packages/babel-runtime-corejs3/core-js(-stable)?
.
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.
@JLHwung Why isn't the package.json enough? |
@nicolo-ribaudo native ESM in Node.js requires the file extension to be in the import specifier: https://nodejs.org/api/esm.html#esm_mandatory_file_extensions |
Thanks, I reopened the issue |
Currently
esm/
helpers are broken: when you try to nativelyimport
them, they are parsed as scripts and thus throw an error.Assing
type: module
is a better fix than renaming the files to*.mjs
, because this isn't a breaking change.I only tested this PR manually because: