-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 js extension to preset-env generated polyfill imports #10862
Add js extension to preset-env generated polyfill imports #10862
Conversation
@@ -152,11 +152,11 @@ export function isPolyfillSource(source: ?string): boolean { | |||
} | |||
|
|||
const modulePathMap = { | |||
"regenerator-runtime": "regenerator-runtime/runtime", | |||
"regenerator-runtime": "regenerator-runtime/runtime.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.
regenerator-runtime
works in browsers, so it currently works with AMD I think.
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.
regenerator-runtime/runtime.js
does not use define
to declare its name and dependencies, if any. So I guess it is likely that no one consume it as an AMD module.
2515fce
to
4f7bb76
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/34693/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f8afd66:
|
You need to patch the vue e2e test similarly to what we did in @sodatea This PR will make |
@nicolo-ribaudo Thanks for the caution! I've fixed the tests. |
@JLHwung mind fixing the conflicts? EDIT: @nicolo-ribaudo i dunno what you're talking about ;) |
@existentialism I think you pinged the wrong person 😛 Btw, fixing the conflicts probably also fixes the e2e tests, since they are failing exactly in those two files. |
4f7bb76
to
f8afd66
Compare
Spammish, but tomorrow it's the birthday of this PR 🥳 |
preset-env
generated esm polyfill imports will throw on Node.js 13, fixes #12378In this PR we add
.js
extension to the injected polyfill imports by@babel/preset-env
. The new import specifierpath/to/polyfill.js
could cause trouble for AMD module compatibility (see #10832 ) but practically it is okay in this scenario because both our upstream polyfills: core-js and regenerator do not support amd.Note that this PR is different than #10549 which handles
transform-runtime
instead./cc @rwjblue