GitXplorerGitXplorer
p

gulp-jsxify

public
9 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
8345c8ff78f56eb53751df5547e0e3f935b9897b

0.2.0

pparroit committed 11 years ago
Unverified
4efb8f1f17aeabb53b3bed066b8077d2c4fefce3

changed readme

pparroit committed 11 years ago
Unverified
be5f2e235de7c75bf58b85efdff3c47d20a604db

warning on undeclared tag in html

pparroit committed 11 years ago
Unverified
4971344844f9deeb5c88c5ca06eb83375589ec5d

only require used tags to avoid circular dependency within modules

pparroit committed 11 years ago
Unverified
b89ca0bde24f3db49ac88ef1c3ccb80c0d9e0d7e

changed readme

pparroit committed 11 years ago
Unverified
adf9adf3bec11b404eca0ba991e651f1d5edb92a

changed readme

pparroit committed 11 years ago

README

The README file for this repository.

gulp-jsxify Build Status

Precompile HTML templates into Facebook React JSX

Issues with the output should be reported on the React issue tracker.

You'll find an introductory blog post here

Install

$ npm install --save-dev gulp-jsxify

Usage

var gulp = require('gulp');
var jsxify = require('gulp-jsxify');

gulp.task('default', function() {
    
    return gulp.src('template.html')
        .pipe(jsxify({
            requires:{
                AnotherWidget: './another-widget'
            }
        }))
        .pipe(gulp.dest('./jsx-files'));
});

Templates content is wrapped with the following code:

/** @jsx React.DOM */
'use strict';

//here we add requires as defined below
            
module.exports = function(args){ 
            return (
                    //here we add template content
            
            );
};

API

jsxify(options)

options.requires

Type: object
Default: {React: 'react'}

Define a set of React widget required by your templates. React dependency is inserted by defaqult if not present.

Relative requirements must be relative to the folder where gulp.dest() final js files

License

MIT © Andrea Parodi