Add js extension to preset-env generated polyfill imports#10862
Add js extension to preset-env generated polyfill imports#10862nicolo-ribaudo merged 2 commits intobabel:mainfrom
Conversation
|
|
||
| const modulePathMap = { | ||
| "regenerator-runtime": "regenerator-runtime/runtime", | ||
| "regenerator-runtime": "regenerator-runtime/runtime.js", |
There was a problem hiding this comment.
regenerator-runtime works in browsers, so it currently works with AMD I think.
There was a problem hiding this comment.
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-envgenerated esm polyfill imports will throw on Node.js 13, fixes #12378In this PR we add
.jsextension to the injected polyfill imports by@babel/preset-env. The new import specifierpath/to/polyfill.jscould 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-runtimeinstead./cc @rwjblue