Compile eval calls with string literals
In
eval("(() => 'foo')");
Out
eval("(function () { return 'foo'; })");
$ npm install babel-plugin-transform-eval
.babelrc
{
"plugins": ["transform-eval"]
}
$ babel --plugins transform-eval script.js
require("babel-core").transform("code", {
plugins: ["transform-eval"]
});