1.0.6 • Published 5 years ago
@rocketstation/babel-plugin-component-component v1.0.6
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
Name | Type | Vals | Default | Description |
---|---|---|---|---|
blackBoxAlias | String | Any String | '$' | Defines black box alias |
Scope
components/**/component.js
Magic
- Modifies
class {} or class Component {}
toclass 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