Align regenerator-transform import with native ESM#13086
Align regenerator-transform import with native ESM#13086nicolo-ribaudo merged 2 commits intobabel:mainfrom
regenerator-transform import with native ESM#13086Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45076/ |
|
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 ebf7a43:
|
| src => src.startsWith("babel-plugin-polyfill-"), | ||
| ]; | ||
| const depsUsing__esModuleAndDefaultExport = src => | ||
| src.startsWith("babel-plugin-polyfill-") || src === "regenerator-transform"; |
There was a problem hiding this comment.
Just wondering, is there anything else other than regenerator-transform that would need to be added? Would we need to update this if we added another similar dep?
Oh so via #13017, it's only esm/cjs packages that have been transformed with babel?
There was a problem hiding this comment.
Yes, the only problem is dependencies that have been transformed with Babel.
I managed to create a working build just with this change so I think it's the only one (also I tried looking for other export ... from of dependencies and this is the only one), but if we'll ever find a new one we can always add it to this list.
There was a problem hiding this comment.
Ok was just worried it would break without us knowing and whether one could verify!
|
Merging since this is a really small internal change, that I forgot to do in another PR. The new tests doesn't test changed behavior, but it's just to be 100% sure I didn't accidentally break something. |
I missed this in #12795 because it was using
export ... fromrather than import.regenerator-transformis a compiled CJS module, so thedefaultexport in Node.js ismodule.exportsand we'll need to get.defaultfrommodule.exports(thus.defaultfrom thedefaultexport).