Skip to content

Instantly share code, notes, and snippets.

@ngryman
Created May 26, 2015 18:51
Show Gist options
  • Select an option

  • Save ngryman/bcb96f013545cc60c6a2 to your computer and use it in GitHub Desktop.

Select an option

Save ngryman/bcb96f013545cc60c6a2 to your computer and use it in GitHub Desktop.
gulp + browserify
var browserify = require('browserify')
, gulp = require('gulp')
, gutil = require('gulp-util')
, mocha = require('gulp-mocha')
, source = require('vinyl-source-stream')
, watchify = require('watchify');
var b = watchify(browserify({
entries: ['./app/index.js'],
debug: true
}));
function bundle() {
return b.bundle()
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(source('app.js'))
.pipe(gulp.dest('./dist'));
}
gulp.task('browserify', bundle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment