1.0.6 • Published 5 years ago

@rocketstation/babel-plugin-component-component v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Babel Plugin Component Component

Babel Plugin Component Component adds magic to components/**/component.js

Installation

npm i @rocketstation/babel-plugin-component-component

Usage

.babelrc

{ "plugins": ["@rocketstation/babel-plugin-component-component"], }

Options

NameTypeValsDefaultDescription
blackBoxAliasStringAny String'$'Defines black box alias

Scope

components/**/component.js

Magic

  • Modifies class {} or class Component {} to class PathToComponent {}
  • Modifies $box(config) to $.element('div', config)
  • Modifies $text(config) to $.element('span', config)
  • Modifies $link(path, config) to $.element('a', { b: { href: path, ...b }, p, s })
  • Modifies $img(path, text, config) to $.element('img', { b: { alt: text, src: path, ...b }, p })
  • Modifies $shape(canvas, config) to $.element('svg', { b: { viewBox: canvas, ...b }, p, s })
  • Modifies $path(shape, config) to $.element('path', { b: { d: shape, ...b }, p })

License

Babel Plugin Component Component is licensed under the MIT License

Created by RocketStation

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago