Skip to content

Instantly share code, notes, and snippets.

@Radostin
Last active March 20, 2016 20:35
Show Gist options
  • Save Radostin/f980358e65f3af82e051 to your computer and use it in GitHub Desktop.
Save Radostin/f980358e65f3af82e051 to your computer and use it in GitHub Desktop.
bundling reactjs components with Gulp
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
gulp.task('browserify', function () {
return browserify('./js/app.js')
.transform(babelify, {stage: 0})
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('js'));
});
gulp.task('watch', function () {
gulp.watch('**/*.js', ['browserify']);
gulp.watch('**/*/*.js', ['browserify']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment