babel-plugin-polyfill-corejs2 intelligently adds only the required core-js polyfills for features used in your code, targeting older environments. It leverages Babel to analyze your AST and determines specifically which polyfills are necessary based on your code and specified browser targets. This plugin helps to drastically reduce bundle size by avoiding inclusion of unnecessary polyfills, focusing exclusively on what's missing for specified legacy JavaScript environments. It integrates smoothly with Babel's configuration.