1
0
Форкнуть 0
This plugin makes sure that your custom elements always have a name property, even after minifying.
Перейти к файлу
Kristján Oddsson 9075104aa4
0.0.2
2018-10-09 16:17:23 +01:00
src remove comment 2018-10-09 12:18:45 +01:00
test fix lint errors 2018-10-09 11:59:23 +01:00
.babelrc initial commit 2018-10-09 11:22:21 +01:00
.eslintignore fix lint errors 2018-10-09 11:59:23 +01:00
.eslintrc.json add linting 2018-10-09 11:28:36 +01:00
.gitignore initial commit 2018-10-09 11:22:21 +01:00
.npmignore initial commit 2018-10-09 11:22:21 +01:00
.travis.yml initial commit 2018-10-09 11:22:21 +01:00
LICENSE Create LICENSE 2018-10-09 13:28:44 +01:00
README.md Update README.md 2018-10-09 16:09:05 +01:00
package-lock.json 0.0.2 2018-10-09 16:17:23 +01:00
package.json 0.0.2 2018-10-09 16:17:23 +01:00
prettier.config.js add linting 2018-10-09 11:28:36 +01:00

README.md

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

.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"]
});