babel-plugin-app-decorators-element-to-function
v0.8.252
Published
babel plugin for app-decorators to extends an HTMLElement in IE and Safari
Downloads
4
Readme
This repository is deprecated. Its merged into: app-decorators/packages/babel-plugin-app-decorators-component
babel-plugin-app-decorators-element-to-function
Babel Plugin for auto generating code
Installation
$ npm install babel-plugin-app-decorators-element-to-function --save
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["app-decorators-element-to-function"]
}
.babelrc options
"plugins": [
["app-decorators-element-to-function"]
]
Via CLI
$ babel --plugins app-decorators-element-to-function script.js
Via Node API
require('babel').transform('code', {
plugins: ['app-decorators-element-to-function']
});
The goal of this babel-plugin is for app-decorators @component:
see also: https://github.com/babel/babel/issues/1548
Example 1
input:
class Foo extends HTMLImageElement {
}
output:
import _elementToFunc from 'app-decorators-element-to-function';
class Foo extends _elementToFunc(HTMLImageElement) {
}
Tests
git clone https://github.com/SerkanSipahi/app-decorators.git
cd app-decorators/packages/app-decorators-element-to-function
npm install
npm run test