Created
February 21, 2014 01:24
-
-
Save takempf/9127061 to your computer and use it in GitHub Desktop.
I'm terrible at uglifyify
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 characters
| 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