509 B
509 B
babel-plugin-eval
Compile eval calls with string literals
Example
In
eval("(() => 'foo')");
Out
eval("(function () { return 'foo'; })");
Installation
$ npm install babel-plugin-eval
Usage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["eval"]
}
Via CLI
$ babel --plugins eval script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["eval"]
});