0.8.252 • Published 8 years ago
babel-plugin-app-decorators-element-to-function v0.8.252
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 --saveUsage
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.jsVia 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