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
chore: do not provide polyfills on bundling @babel/standalone #12909
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/42855/ |
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 00d4226:
|
babel.config.js
Outdated
unambiguousSources.push("packages/babel-runtime/regenerator"); | ||
// fall through | ||
convertESM = false; | ||
ignoreLib = false; | ||
// rollup-commonjs will converts node_modules to ESM | ||
unambiguousSources.push( |
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.
Nit: we can merge the unambiguousSources.push
calls.
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.
This PR fixes the regression, but I'll also open a PR (to babel-polyfills
I think) to fix the underlying problem: require.resolve
shouldn't even be loaded in the bundle since it's meant to run in the browser; similarly to how we don't bundle fs-specific files for @babel/core
.
I released |
The issue #12907 was introduced in #12458, where we injected
require("module")
in the polyfill forrequire.resolve(_, { paths })
. However, we should not inject it when bundling@babel/standalone
, becauserequire("module")
is not available in browsers.