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
Disable submodule exports #10850
Disable submodule exports #10850
Conversation
Does this also applies when using We should probably consider exposing |
Yes, because People may use
|
568d069
to
360f6e6
Compare
360f6e6
to
482f958
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/24590/ |
This PR has been revamped according to the latest best practise: https://nodejs.org/api/esm.html#esm_main_entry_point_export, to specify both {
"main": "./lib/index.js",
"exports": "./lib/index.js"
} |
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 9d028ee:
|
The e2e test is failing because Before decisions are made by node TSC, I consider |
37ff39b
to
c4a1cb4
Compare
c4a1cb4
to
9d028ee
Compare
This PR adds
exports: "lib/index.js"
to every package except@babel/runtime(-corejs[23])?
, which shall be addressed in #10853 . By doing so we are stating explicitly that every package does not offer submodule exports, i.e.import "@babel/core/src/config"
will bail because this file belongs to internal implementation details.Even we don't specify
exports: false
, the following imports will still bailbecause the subpath
./src/config/index.js
is not defined as export path in package.json. So it should not break anyone.Note that it is a breaking change because
exports
takes precedence overmain
so the following will bail on node.js >= 13.1 or when--experimental-modules
is activated: