@babel/plugin-transform-function-name
NOTE: This plugin is included in
@babel/preset-env
Examples
In
let number = x => x;
Out
var number = function number(x) {
return x;
};
Installation
npm install --save-dev @babel/plugin-transform-function-name
Usage
With a configuration file (Recommended)
{
"plugins": ["@babel/plugin-transform-function-name"]
}
Via CLI
babel --plugins @babel/plugin-transform-function-name script.js
Via Node API
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-transform-function-name"],
});