Last active
August 29, 2015 14:04
-
-
Save bongole/ff58db23732aa55f8363 to your computer and use it in GitHub Desktop.
gulp + react + browserify
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
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']) |
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
{ | |
"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