I need to use ES6 code and also Object.entries in my code. After looking into babel I saw that they recommended to use babel-preset-env
. But I am writing step definitions in webdriverIO and they recommend to use babel-plugin-transform-runtime
so that it doesn't pollute the global scope. Let me know if I can use babel-preset-env and still not pollute global scope.
Asked
Active
Viewed 490 times
1

Manoj Bharadwaj
- 191
- 1
- 1
- 10
1 Answers
0
I think the answer to your question is mostly no. Babel 'preset-env' with 'useBuiltins' will indeed polyfill/pollute the global scope. Particularly, I think it uses core-js to do so, which polyfills the global scope by default.
Sources:
https://babeljs.io/docs/en/babel-preset-env
https://github.com/babel/babel/issues/7267#issuecomment-373560397

Tom
- 471
- 3
- 11