component-react
v1.0.0
Published
A plugin to transpile React jsx files for the component builder
Downloads
7
Readme
component-react
A plugin to transpile React .jsx files for the component builder.
Install
$ npm install component-react
Usage
Add your .jsx
files to the scripts
array in your component.json
:
{
"scripts": [
"index.js",
"button.jsx"
]
}
Use the plugin during your build process:
var Builder = require('component-builder');
var react = require('component-react');
var fs = require('fs');
var builder = new Builder(__dirname);
builder.use(less);
builder.build(function (err, res) {
if (err) {
throw err
}
fs.writeFileSync('build/build.js', res.require + res.js);
if (res.css) {
fs.writeFileSync('build/build.css', res.css);
}
});
License
MIT
Authors
- Neil Jagdish Patel [email protected]