babel-plugin-app-decorators-element-to-function

0.8.252 • Public • Published

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

Dependency Status devDependency Status

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

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-app-decorators-element-to-function

Weekly Downloads

7

Version

0.8.252

License

MIT

Last publish

Collaborators

  • serkansipahi