Skip to content

Instantly share code, notes, and snippets.

@nicknikolov
Created July 15, 2014 18:06
Show Gist options
  • Save nicknikolov/5dca5eb2e5d1d8aa3c55 to your computer and use it in GitHub Desktop.
Save nicknikolov/5dca5eb2e5d1d8aa3c55 to your computer and use it in GitHub Desktop.
pex gulp build file
var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
gulp.task('watch', function() {
var bundler = watchify('./testpex3.js');
bundler.transform({global:true}, 'brfs');
bundler.ignore('plask');
bundler.on('update', rebundle);
function rebundle () {
return bundler.bundle()
// log errors if they happen
.on('error', function(e) {
gutil.log('Browserify Error', e);
})
.pipe(source('pex-main.js'))
.pipe(gulp.dest('./dist'))
}
return rebundle()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment