Skip to content

Instantly share code, notes, and snippets.

@zofe
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save zofe/0221049792604fbe1224 to your computer and use it in GitHub Desktop.

Select an option

Save zofe/0221049792604fbe1224 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var react = require('gulp-react');
var browserify = require('gulp-browserify');
var uglify = require('gulp-uglify');
gulp.task('jsx', function () {
return gulp.src('./src/**/*.jsx')
.pipe(react({harmony: true}))
.pipe(browserify({insertGlobals : true}))
.pipe(uglify())
.pipe(gulp.dest('./lib'));
});
gulp.task('watch', function() {
gulp.watch('src/**/*.jsx', ['jsx']);
});
gulp.task('default',['watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment