@triptease/babel-plugin-transform-class-prototype-name

1.0.3 • Public • Published

babel-plugin-class-display-name Build Status

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";

Readme

Keywords

Package Sidebar

Install

npm i @triptease/babel-plugin-transform-class-prototype-name

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • theomessin
  • danielbodart
  • triptease-root