Why does `@babel/transform-runtime` not polyfill `string.replace` for Edge 18?

Viewed 438

From the Babel docs, it seems I can polyfill my code using either @babel/preset-env or @babel/transform-runtime in my babel config file.

@babel/preset-env with useBuiltIns: usage will add a polyfill for string.replace when my targeted list of browsers includes Edge 18.

Using @babel/transform-runtime instead, string.replace seems not to be polyfilled.

I'd like to use both, but the docs recommend not to:

enter image description here

Should I use @babel/preset-env ? Or is @babel/runtime more up-to-date and therefore doesn't bring in string.replace polyfill?

0 Answers
Related