Ship fewer core-js polyfills by matching imports to your browser targets
Stop shipping every core-js polyfill to every browser. Use core-js-compat with browserslist to import only the ECMAScript polyfills your supported targets actually need.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop shipping every core-js polyfill to every browser. Use core-js-compat with browserslist to import only the ECMAScript polyfills your supported targets actually need.
Blanket core-js imports bloat bundles and risk overriding natives. Targeted modular imports with runtime feature detection give smaller builds and safer polyfills for web and Node apps.
Stop shipping every core-js polyfill. Import only the ECMAScript features your app uses and verify the savings in your production bundle.
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.