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
Define fallback exports
for @babel/runtime
on old Node
#12877
Define fallback exports
for @babel/runtime
on old Node
#12877
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/42200/ |
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 ea6e63a:
|
Yes, this approach would cover Node.js 13.0 - Node.js 13.6. 12.X and 14.X are all fine here though. 1believe these support ranges should be possible to ignore within the next few months ideally though as it's not an LTS version. |
Yeah, in Babel 8 (right after Node.js 10 goes EOL) we'll drop non-lts versions (except for 15). |
Conditional exports have been introduced in Node.js 13.7.0. Previous Node.js versions still read the
exports
field inpackage.json
but throw when they see conditions.This PR adds a fallback (using the array exports "syntax"): older Node.js versions will fail loading the conditional exports, and fallback to the second array entry.
There is comment in the build script that explains it.
@guybedford I'm sorry to ping you, but I just learned this by experimenting and reading the docs. Is my understanding correct? 😅