Question
Preset‑Env Target Limits for Low‑Traffic Workloads
Rahul Vale
0 reputation · 27 Oct 2025, 12:49 UTC
137.3K views0
Goal
For a low‑traffic application, the primary objective is to shrink the JavaScript bundle and speed up the build by eliminating polyfills and syntax transformations that are unnecessary for the browsers actually used.
Constraints & Uncertainty
- The
targetsoption in@babel/preset‑envis evaluated at compile time; any change requires a full rebuild. - Choosing a too‑narrow target set may break functionality in edge browsers that are still in use by a small subset of users.
- Using
useBuiltIns: "usage"increases build time because Babel must statically analyze the entire codebase to determine which core‑js polyfills to inject.
Unresolved Questions
- What combination of
targets(e.g., Chrome 90+, Safari 14+) anduseBuiltInssetting yields the optimal trade‑off between bundle size and build duration for a typical low‑traffic workload? - How does the choice of
corejs: 3versuscorejs: 2affect polyfill size and compatibility when targeting only the latest major browsers? - Can
ignoreBrowserslistConfigbe leveraged to override a project‑wide.browserslistrcwithout introducing conflicts in a monorepo that shares Babel configurations?