babel-plugin-transform-mill
v0.1.0
Published
Mill engine transform
Downloads
3
Readme
babel-plugin-transform-mill
This plugins build for Mill blog.
Example
In
<div>
<span onClick={onClick}>
{post.name}
{a.b}
</span>
</div>
Out
"use strict;"
module.exports = function (React, props) {
var onClick = props.onClick,
post = props.post,
a = props.a;
return React.createElement("div", null, React.createElement("span", {
onClick: onClick
}, post.name, a.b));
};
Installation
$ npm install babel-plugin-transform-mill
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["transform-mill"]
}
Via CLI
$ babel --plugins babel-plugin-transform-mill script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["transform-mill"]
});