Last active
August 29, 2015 14:14
-
-
Save mateusvahl/2310fee42ba99941f3e3 to your computer and use it in GitHub Desktop.
Gulp + React + Browserify + 6to5
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 reactify = require('reactify'); | |
var source = require('vinyl-source-stream'); | |
var to5ify = require('6to5ify'); | |
gulp.task('scripts', function() { | |
browserify({ | |
insertGlobals: true, | |
entries: ['./src/index.jsx'], | |
transform: ['reactify'], | |
extensions: ['.jsx'] | |
}) | |
.transform(to5ify) | |
.bundle() | |
.pipe(source('index.js')) | |
.pipe(gulp.dest('./dist')); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('./src/index.jsx', ['scripts']); | |
}); | |
gulp.task('default', ['watch']); |
Author
mateusvahl
commented
Jan 23, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment