Skip to main content

@babel/plugin-transform-function-name

info

This plugin is included in @babel/preset-env

Examples

In

JavaScript
let number = x => x;

Out

JavaScript
var number = function number(x) {
return x;
};

Installation

npm install --save-dev @babel/plugin-transform-function-name

Usage

babel.config.json
{
"plugins": ["@babel/plugin-transform-function-name"]
}

Via CLI

Shell
babel --plugins @babel/plugin-transform-function-name script.js

Via Node API

JavaScript
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-transform-function-name"],
});