GitXplorerGitXplorer
g

babel-plugin-ensure-name-for-custom-elements

public
11 stars
8 forks
2 issues

Commits

List of commits on branch master.
Verified
9075104aa4118b4503b9f5dcabb14f7e236e8e15

0.0.2

kkoddsson committed 6 years ago
Verified
9bd25aee58994e19eca5f0c02164430c4df0c80c

only include files in /lib in package

kkoddsson committed 6 years ago
Verified
0c66938550fd26f826d222e2b795d06320140708

Update README.md

kkoddsson committed 6 years ago
Verified
1ec3eb829e0fa8fafc9eb38ffda6cb7961fec664

Create LICENSE

kkoddsson committed 6 years ago
Verified
0ee43e5c5e0b349117b7d264ecfc73f4afcc1a28

add name to package.json

kkoddsson committed 6 years ago
Verified
42e9f2dc028c213f499907f3d8e0acb3af4db649

0.0.1

kkoddsson committed 6 years ago

README

The README file for this repository.

babel-plugin-ensure-name-for-custom-elements

This plugin makes sure that your custom elements always have a name property, even after minifying.

Example

In

class FooElement extends HTMLElement { }

Out

class FooElement extends HTMLElement {
  static get name() {
    return "FooElement";
  }
}

Installation

$ npm install babel-plugin-ensure-name-for-custom-elements

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["ensure-name-for-custom-elements"]
}

Via CLI

$ babel --plugins ensure-name-for-custom-elements script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["ensure-name-for-custom-elements"]
});