Skip to content

Instantly share code, notes, and snippets.

@takempf
Created February 21, 2014 01:24
Show Gist options
  • Select an option

  • Save takempf/9127061 to your computer and use it in GitHub Desktop.

Select an option

Save takempf/9127061 to your computer and use it in GitHub Desktop.
I'm terrible at uglifyify
var gulp = require('gulp');
var vinylSource = require('vinyl-source-stream');
var watchify = require('watchify');
gulp.task( 'browserify', function(){
// use watchify instead of gulp-browserify and gulp.watch
var bundler = watchify('./src/universe-experiment.js');
bundler.transform('hbsfy');
bundler.transform('uglifyify');
var rebundle = function(){
return bundler.bundle()
.pipe( vinylSource('universe-experiment.js') )
.pipe( gulp.dest('./') );
};
bundler.on( 'update', rebundle );
return rebundle();
});
gulp.task( 'default', ['browserify'] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment