@babel/plugin-transform-eval

v7.0.0-beta.38
Compile eval calls with string literals
babel-plugin

@babel/plugin-transform-eval

This plugin allows Babel to compile eval calls with string literals.

Example

In

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

Out

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

Installation

npm install --save-dev @babel/plugin-transform-eval

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["@babel/plugin-transform-eval"]
}

Via CLI

babel --plugins @babel/plugin-transform-eval script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-transform-eval"]
});
npm i @babel/plugin-transform-eval

Metadata

  • MIT
  • Whatever
  • Unknown
  • released 1/17/2018

Downloads