-
-
Save kingease/8f149f3ecd0b2cf18e4f to your computer and use it in GitHub Desktop.
Revisions
-
kingease revised this gist
Jan 2, 2015 . No changes.There are no files selected for viewing
-
a-axton created this gist
May 25, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ var browserify = require('browserify'); var watchify = require('watchify'); var reactify = require('reactify'); var gulp = require('gulp'); var handleErrors = require('../util/handleErrors'); var source = require('vinyl-source-stream'); function scripts(watch) { var bundler, rebundle; if(watch) { bundler = watchify('./app/scripts/app.js'); } else { bundler = browserify('./app/scripts/app.js'); } bundler.transform(reactify); rebundle = function() { var stream = bundler.bundle({debug: true}); stream.on('error', handleErrors); stream = stream.pipe(source('app.js')); return stream.pipe(gulp.dest('./build/')); }; bundler.on('update', rebundle); return rebundle(); } gulp.task('browserify-build', function() { return scripts(false); }); gulp.task('browserify-watch', function() { return scripts(true); });