Home:ALL Converter>what is the relationship of babel polyfill and runtime?

what is the relationship of babel polyfill and runtime?

Ask Time:2017-03-27T10:41:43         Author:zzzgoo

Json Formatter

Babel includes a polyfill that includes a custom regenerator runtime and core-js.

Another purpose of this transformer is to create a sandboxed environment for your code. If you use babel-polyfill and the built-ins it provides such as Promise, Set and Map

According to the documentation,I have think about these information and get the follow points:

  1. polyfill is included in babel,so if we use babel-loader,polyfill will be automatically contained in the transpiled result.
  2. babel-plugin-transform-runtime will only alias the name of the important classes,itself does not contain any polyfill or runtime.
  3. if you don't use babel-plugin-transform-runtime,the polifill will also be contained in the transpiled result,but without being aliased.

Am I right?

Author:zzzgoo,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/43037136/what-is-the-relationship-of-babel-polyfill-and-runtime
yy