Babel plugin that automatically injects imports for core-js@2 polyfills based on language features used in the code. Current stable version is 0.4.17, released as part of the Babel polyfills project. Unlike manual core-js imports or @babel/polyfill, this plugin offers fine-grained control via methods like 'usage-global' (per-file polyfill injection into global scope), 'usage-pure' (pure expressions without side effects), and 'entry-global' (replaces core-js import entries). Requires @babel/core peer dependency. Development is focused on core-js@2 compatibility; for core-js@3 use babel-plugin-polyfill-corejs3.
npm install babel-plugin-polyfill-corejs2Verified import paths — ran on the pinned version, not inferred.
Install the plugin and core-js@2 peer dependency. Note: core-js@2 is a required runtime dependency for polyfills.
Replace this plugin with babel-plugin-polyfill-corejs3 and core-js@3.
Run 'npm install core-js@2' or equivalent.
Update to 0.4.x and explicitly set method to 'entry-global' if you previously relied on global injection.
Select method carefully: 'usage-pure' for library development, 'usage-global' for applications.
Add corresponding proposal plugins (e.g., @babel/plugin-proposal-optional-chaining) alongside this plugin.
Install core-js@2: npm install core-js@2
Update @babel/core to ^7.4.0.
Add @babel/plugin-transform-regenerator or manually import regenerator-runtime.
Add 'import "core-js"' at the entry point of your application, or switch to 'usage-global' method.
No dependency data recorded yet.