0.1.6 • Published 9 years ago

gulp-html2react v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago