Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Created February 5, 2015 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaomilho/167f92ec03aaa5f3da56 to your computer and use it in GitHub Desktop.
Save joaomilho/167f92ec03aaa5f3da56 to your computer and use it in GitHub Desktop.
Basic react + cjsx converter
'use strict';
var gulp = require('gulp'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),
runSequence = require('run-sequence'),
react = require('gulp-react'),
cjsx = require('gulp-cjsx');
gulp.task('app', function() {
return gulp.src(['./src/app.cjsx'])
.pipe(cjsx())
.pipe(react())
.pipe(gulp.dest('./dist/'));
});
gulp.task('browserify', function() {
return browserify("./dist/app.js")
.bundle()
.pipe(source("app.js"))
.pipe(gulp.dest("./dist/"))
});
gulp.task('default', function(callback){
runSequence(['app'],
['browserify'],
callback);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment