Reducing Bundle Size with Babel's useBuiltIns: 'usage'
Stop bloating your JS bundles with unnecessary polyfills. Learn how to use Babel's useBuiltIns: 'usage' to inject only the code your target browsers actually need.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop bloating your JS bundles with unnecessary polyfills. Learn how to use Babel's useBuiltIns: 'usage' to inject only the code your target browsers actually need.
Learn how to set up Babel preset-env with useBuiltIns: usage to transpile ES2015+ code while injecting only the polyfills actually needed for your target browsers.
Learn how to add a reliable Promise.allSettled polyfill using core-js, see a concrete example, and understand the trade-offs before adding it to your bundle.
Learn how to use Core‑JS 3.x to polyfill only the features you need. This guide shows the difference between <code>pure</code> and <code>stable</code> imports, walks through a Promise polyfill example, and explains how to keep your bundle lean.
Learn how Babel’s useBuiltIns: 'usage' option adds only the polyfills your code actually uses, reducing bundle size while maintaining compatibility.
Learn how to implement Array.prototype.flat using core-js with a minimal footprint. This guide covers targeted feature imports, load-order requirements, and operational verification.
Guidance on importing only the needed polyfill, keeping globals clean, and verifying legacy support in a JavaScript library.
For an internal tool that must run on IE10, the team needs to decide how to provide CSS Grid layouts while keeping overall effort low. The options are to author a separate stylesheet using IE10’s prefixed -ms-grid properties or to load a JavaScript polyfill that translates modern display: grid syntax to the prefixed engine. The prefixed approach avoids runti
Goal: ship the smallest polyfill set for the project’s browserslist targets without duplicating core-js modules across the bundle. The application has no global polyfill entry file, but it does have a single JavaScript entry point. With @babel/preset-env 7.x and core-js 3, useBuiltIns: "usage" scans each file and emits only polyfills for APIs actually refere