babel/packages/babel-plugin-transform-runtime

babel-plugin-transform-runtime

Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

Installation

$ npm install babel-plugin-transform-runtime

Usage

.babelrc

// without options
{
  "plugins": ["transform-runtime"]
}

// with options
{
  "plugins": [
    ["transform-runtime", {
      "polyfill": false,
      "regenerator": true
    }]
  ]
}

Via CLI

$ babel --plugins transform-runtime script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-runtime"]
});