A Babel plugin that automatically injects imports for es-shims polyfills based on target environments. Version 0.10.11, stable release part of the babel-polyfills monorepo. Key differentiator: modular approach to polyfilling ECMAScript built-ins, compatible with `core-js` and custom shims. Integrates with `@babel/preset-env` and supports `useBuiltIns: 'usage'` style. Active development, follows Babel releases.
npm install babel-plugin-polyfill-es-shimsVerified import paths — ran on the pinned version, not inferred.
Configures Babel to inject imports for ES shims based on target browsers, using the usage-global method.
Use method: 'usage-global' or method: 'usage-pure'
Update @babel/core to latest 7.x or pre-release 8.x
Ensure @babel/preset-env is configured with `useBuiltIns: false` and plugin targets are aligned
Use `method: 'usage-global'` for global polyfills or ensure tree-shaking is configured correctly
Consider migrating to babel-plugin-polyfill-corejs3 for better maintenance and compatibility
npm install babel-plugin-polyfill-es-shims --save-dev
Change method to 'usage-global' or 'usage-pure' in plugin options
Ensure the needed polyfill is included in your es-shims dependency or use core-js polyfills with babel-plugin-polyfill-corejs3