babel-plugin-runtime

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

Usage no npm install needed!

<script type="module">
  import babelPluginRuntime from 'https://cdn.skypack.dev/babel-plugin-runtime';
</script>

README

babel-plugin-runtime

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

Installation

$ npm install babel-plugin-runtime

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["runtime"]
}

Via CLI

$ babel --plugins runtime script.js

Via Node API

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