chore: do not provide polyfills on bundling @babel/standalone#12909
chore: do not provide polyfills on bundling @babel/standalone#12909JLHwung merged 3 commits intobabel:mainfrom
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:
|
| 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.
Nit: we can merge the unambiguousSources.push calls.
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
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.