gulp-html2react
v0.1.6
Published
compile html to react syntax
Downloads
2
Readme
gulp-html2react
Compile html to React syntax.
Inspired by gulp-react
##Motivation I don't like write html in js file,so i build this gulp.
Install
$ npm install --save-dev gulp-html2react
Usage
var gulp = require('gulp');
var html2react = require('gulp-html2react');
gulp.task('react', function() {
return gulp.src('app/javascripts/templates/*.html')
//compile html to JavaScript in React syntax.
.pipe(html2react())
.pipe(gulp.dest('temp/javascripts/templates'));
});
##Custom Element If you use custom element in html:
<div>
<HelloMessage name="John" />
</div>
You Must add require path about the custom element component:
<!-- var HelloMessage = require('.././components/hello_message'); -->
<div>
<HelloMessage name="John" />
</div>
##License
MIT © ocowchun