Skip to content

Instantly share code, notes, and snippets.

@mitchelkuijpers
Last active August 29, 2015 14:00
Show Gist options
  • Save mitchelkuijpers/11282137 to your computer and use it in GitHub Desktop.
Save mitchelkuijpers/11282137 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var reactify = require('reactify');
var production = process.env.NODE_ENV === 'production';
gulp.task('scripts', function () {
var bundler = browserify('./src/client.js', {basedir: __dirname, debug: !production}});
bundler.transform(reactify);
var stream = bundler.bundle();
return stream
.pipe(source('bundle.js'))
.pipe(gulp.dest('./assets/js'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment