kabisa / maji

Maji is a framework to build great hybrid mobile apps.
https://www.majimobile.com/
MIT License
18 stars 10 forks source link

Using experimental Babel feature `useBuiltIns: "usage"` can lead to issues #251

Closed ljpengelen closed 5 years ago

ljpengelen commented 5 years ago

I was using the Babel feature useBuiltIns: "usage" in a Maji-like project that is supposed to support IE11 as well. It turns out that Babel doesn't automatically include polyfills for language feature that it should polyfill if these features are used in dependencies. In this particular case, Babel didn't polyfill promises, while a number of dependencies relied on promises, and our app failed to work in IE.

To be on the safe side, it might be better to stick with useBuiltIns: "entry": https://babeljs.io/docs/en/babel-preset-env#usebuiltins-entry

pascalw commented 5 years ago

Oh that's a gotcha indeed @ljpengelen. I agree that entry might be a better default. It's still possible then for projects to switch to usage if they want to get bundle size down and understand the caveats.

Could you make a PR for this?