gulp-html2jsx

1.0.3 • Public • Published

gulp-react Build Status

Converts HTML to JSX for use with React.

Install

$ npm install --save-dev gulp-html2jsx

Usage

var gulp = require('gulp');
var html2jsx = require('gulp-html2jsx');
 
gulp.task('default', function () {
    return gulp.src('template.html')
        .pipe(html2jsx({/* if any opts */}))
        .pipe(gulp.dest('dist'));
});

API

html2jsx(options)

options:

{
  createClass: true,
  outputClassName: 'AwesomeComponent'
}

Sample:

<p> Hello </p>

Get converted to:

var NewComponent = React.createClass({
  render: function() {
    return (
 
      <p> Hello </p>
    );
  }
});

License

MIT © Hemanth.HM

Package Sidebar

Install

npm i gulp-html2jsx

Weekly Downloads

10

Version

1.0.3

License

MIT

Last publish

Collaborators

  • hemanth