Created
February 5, 2015 09:27
-
-
Save joaomilho/167f92ec03aaa5f3da56 to your computer and use it in GitHub Desktop.
Basic react + cjsx converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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