Caveats
You may alternatively/selectively include what you need:
There is also the loose
option for some of these plugins.
Since Babel assumes that your code will run in an ES5 environment it uses ES5functions. So if you're using an environment that has limited or no support forES5 such as lower versions of IE then using @babel/polyfill will add support for these methods.
If you're inheriting from a class then static properties are inherited from itvia ,this is widely supported but you may run into problems with much older browsers.
For classes that have s, the super class won't resolve correctly. You canget around this by enabling the loose
option in the transform-classes plugin.
Getters/setters (8 and below)
In IE8 Object.defineProperty
can only be used on DOM objects. This isunfortunate as it's required to set getters and setters. Due to this ifyou plan on supporting IE8 or below then the usage of getters and settersisn't recommended.
Modules
By default, when using modules with Babel a non-enumerable __esModule
propertyis exported. This is done through the use of Object.defineProperty
which isunsupported in IE8 and below. A workaround for this is to enable the option in your corresponding module plugin.