Skip to content

Instantly share code, notes, and snippets.

@bongole
Last active August 29, 2015 14:04
Show Gist options
  • Save bongole/ff58db23732aa55f8363 to your computer and use it in GitHub Desktop.
Save bongole/ff58db23732aa55f8363 to your computer and use it in GitHub Desktop.
gulp + react + browserify
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var reactify = require('reactify');
gulp.task('build', function(){
var bundler = browserify('./app/app.js');
bundler.transform(reactify, {"es6": true});
return bundler.bundle()
.pipe(source("app.js"))
.pipe(gulp.dest("./js/"));
});
gulp.task('watch', function(){
gulp.watch('app/**/*.js', ['build']);
});
gulp.task('default', ['build'])
{
"name": "react",
"version": "0.0.0",
"description": "",
"main": "gulpfile.js",
"dependencies": {},
"devDependencies": {
"browserify": "^5.0.3",
"gulp": "^3.8.6",
"gulp-file-include": "^0.4.0",
"reactify": "^0.14.0",
"vinyl-source-stream": "^0.1.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment