Babel preset-env with usage-based core-js polyfills: architecture note
Use Babel 7 preset-env to downlevel syntax and inject only the core-js polyfills your code actually references.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use Babel 7 preset-env to downlevel syntax and inject only the core-js polyfills your code actually references.
A tight target query is what keeps @babel/preset-env from rewriting syntax your users already run. Diff two target sets, keep ES modules for the bundler, and verify the result.
Babel duplicates helper functions in every file by default. @babel/plugin-transform-runtime moves those helpers to shared imports from @babel/runtime, reducing bundle size and making polyfills explicit.