Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

babel-plugin-transform-eval

babel555MIT6.22.0

Compile eval calls with string literals

babel-plugin

readme

babel-plugin-transform-eval

Compile eval calls with string literals

Example

In

eval("(() => 'foo')");

Out

eval("(function () { return 'foo'; })");

Installation

$ npm install babel-plugin-transform-eval

Usage

.babelrc

{
  "plugins": ["transform-eval"]
}

Via CLI

$ babel --plugins transform-eval script.js

Via Node API

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