As an artificat of compiling methods to named function expressions the function name is being considered a "local" binding in the function body. This means that we will throw errors anytime someone would want to create a new local binding with the same name. This is solved by assigning a symbol to function Identifiers that indicates that they should not be considered local bindings.
babel-plugin-transform-es2015-classes
Compile ES2015 classes to ES5
Installation
$ npm install babel-plugin-transform-es2015-classes
Usage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-es2015-classes"]
}
Via CLI
$ babel --plugins transform-es2015-classes script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["transform-es2015-classes"]
});