Skip to content

Instantly share code, notes, and snippets.

@alexanderjeurissen
Created October 10, 2014 20:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderjeurissen/b5c01f021494f60f1c73 to your computer and use it in GitHub Desktop.
Save alexanderjeurissen/b5c01f021494f60f1c73 to your computer and use it in GitHub Desktop.
// updated GulpFile for react-development-environment-setup lesson from egghead.io
// https://egghead.io/lessons/react-development-environment-setup
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var reactify = require('reactify');
gulp.task('browserify', function () {
var bundleStream = browserify('./src/js/main.js')
.transform(reactify)
.bundle();
bundleStream
.pipe(source('main.js'))
.pipe(gulp.dest('dist/js'));
});
gulp.task('copy', function () {
gulp.src('./src/index.html')
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['browserify', 'copy']);
gulp.task('watch', function () {
gulp.watch('src/**/*.*', ['default']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment