@triptease/babel-plugin-transform-class-prototype-name
v1.0.3
Published
Manaully sets a classes prototype.name after each definition
Downloads
21
Keywords
Readme
babel-plugin-class-display-name
After the creation of each class, the plugin manually sets the prototype.name to the class name. This means that after minification class errors still have the correct name.
Installation
$ npm install --dev @triptease/babel-plugin-transform-class-prototype-name
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["@triptease/babel-plugin-transform-class-prototype-name"]
}
Compilation
In
class CustomError extends Error {}
Out
class CustomError extends Error {}
CustomError.prototype.name = "CustomError";
After minification
class a extends Error {}
a.prototype.name = "CustomError";