Ship smaller legacy bundles with Babel preset-env useBuiltIns usage
Use @babel/preset-env with useBuiltIns: "usage" to have Babel inject only the core-js polyfills your code actually uses for the browsers you target, keeping legacy bundles smaller.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use @babel/preset-env with useBuiltIns: "usage" to have Babel inject only the core-js polyfills your code actually uses for the browsers you target, keeping legacy bundles smaller.
Import core-js's stable entry point once at application startup, let browserslist drive the included features, and avoid unstable proposal polyfills that change behavior between releases.
Babel’s useBuiltIns option in @babel/preset‑env lets you auto‑inject polyfills only for the features you actually use. This reduces bundle size, speeds up load times, and keeps your codebase lean. Learn how to configure it, see a concrete example, and understand the trade‑offs.
Configure @babel/preset-env with useBuiltIns: 'usage' and core-js 3 so Babel injects only the polyfills your browserslist targets need — plus how to verify and roll back.
Libraries that polyfill globally can break their consumers' environments. Here's how core-js-pure and Babel's runtime transform let you ship modern code without touching shared prototypes.
Stop shipping unnecessary polyfills. Learn how to use @babel/preset-env and the useBuiltIns option to automatically optimize your JavaScript bundle based on target browser support.
Learn how to configure Babel’s preset‑env with browserslist targets and core‑js ‘usage’ to inject only the polyfills you need, shrink bundle size, and keep legacy browser support.
Stop the 'Undefined' crashes in legacy browsers. Learn the trade-offs between global entry polyfilling and granular imports using core-js to balance compatibility and bundle size.
A technical guide on choosing between 'usage' and 'entry' modes in core-js for Babel builds, comparing bundle size, reliability, and library vs. application strategies.