core-js@2 is obsolete and pollutes the global namespace
@babel/preset-env's corejs: 3 option includes core-js@3 and its polyfills pollute the global namespace too
@babel/plugin-transform-runtime's corejs: 3 option includes core-js-pure@3 which does not pollute the global namespace but polyfills everything regardless of the targets specified by preset-env.
Would also resolve #342
Solution
By using the new Babel Polyfills we can include modern and pure polyfills based on the targets config (none is specified in twitter-text so it will use the default) in the root of babel config.
Problem
core-js@2
is obsolete and pollutes the global namespace@babel/preset-env
'scorejs: 3
option includescore-js@3
and its polyfills pollute the global namespace too@babel/plugin-transform-runtime
'scorejs: 3
option includescore-js-pure@3
which does not pollute the global namespace but polyfills everything regardless of the targets specified by preset-env.Would also resolve #342
Solution
By using the new Babel Polyfills we can include modern and pure polyfills based on the targets config (none is specified in twitter-text so it will use the default) in the root of babel config.