Ship smaller bundles with Babel preset-env usage mode and core-js 3
Use @babel/preset-env with useBuiltIns: 'usage' and core-js 3 to ship only the polyfills your code actually needs for your target browsers.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use @babel/preset-env with useBuiltIns: 'usage' and core-js 3 to ship only the polyfills your code actually needs for your target browsers.
Stop using .reduce() to build objects from maps. Learn how to implement the ES2020 Object.fromEntries polyfill via CoreJS to ensure cross-browser compatibility without bloating your bundle.
Stop shipping all of core-js/stable. Choose the right CoreJS entry point, wire up Babel's useBuiltIns: 'usage', and verify the bundle actually shrank.
Global polyfills bloat bundles and mutate prototypes. Learn how core-js/pure with Babel's usage mode injects only the polyfills your code actually needs, with config, example, and pitfalls.
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.