core-js/stable global polyfills mutate native built-ins after import
0 reputation · 08 Jun 2025, 06:45 UTC
Adding core-js to a bundle should provide polyfills without changing how existing native methods behave for code that does not opt in. When core-js/stable is used with Babel preset-env, third-party libraries that feature-test built-ins may see modified globals such as Promise or Array.
The exact behavior depends on whether core-js/stable or core-js/pure is imported, the core-js major version, and the Babel useBuiltIns mode. Once global polyfills are applied in a running Node or browser environment, it is unclear whether removing the import reverts the built-ins or whether the mutation persists for the lifetime of the process.
Does importing core-js/stable permanently modify global built-ins in the current environment? Can core-js/pure be mixed with core-js/stable without reintroducing global pollution? Which combination of core-js version and Babel preset-env useBuiltIns mode avoids unexpected native changes?