Provides core-js and regenerator-runtime polyfills necessary for a full ES2015+ environment in browsers and Node.js. Version 6.26.0 is the last stable release of this package. Note: babel-polyfill is deprecated in favor of direct use of core-js and regenerator-runtime, or using @babel/preset-env with useBuiltIns. The package was removed in Babel 7.4.0 and has no further releases. This entry applies to v6.26.0.
npm install babel-polyfillVerified import paths — ran on the pinned version, not inferred.
Shows how to import babel-polyfill to enable ES2015+ features like Map, Set, Promise, Symbol, Array.from, Object.assign, and async/await.
Replace import 'babel-polyfill' with import 'core-js/stable'; import 'regenerator-runtime/runtime'; or configure @babel/preset-env.
Do not use babel-polyfill with Babel >=7.4.0. Use direct polyfill imports.
Ensure babel-polyfill is imported only once in your entry point.
Use core-js v3 directly via `import 'core-js/stable'` for full ES2019+ support.
Switch to @babel/plugin-transform-runtime with corejs option for scoped polyfills.
Install core-js and regenerator-runtime, then use import 'core-js/stable'; import 'regenerator-runtime/runtime';
Run npm install babel-polyfill (which installs these as dependencies) or install them separately.
Ensure import 'babel-polyfill' is at the top of your entry file, or import regenerator-runtime directly.
Use only one polyfill source. Prefer core-js/stable over babel-polyfill.