Created
April 27, 2015 18:24
-
-
Save maximilianschmitt/80a0e1f0c8cb7a3301d6 to your computer and use it in GitHub Desktop.
Revisions
-
maximilianschmitt created this gist
Apr 27, 2015 .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,38 @@ 'use strict'; var gulp = require('gulp'); var browserify = require('browserify'); var source = require('vinyl-source-stream'); var notifier = require('stream-notifier'); var watchify = require('watchify'); gulp.task('browserify', function() { var bundler = browserify('./src/main') var bundle = compileBundle(bundler); return bundle(); }); gulp.task('watchify', function() { var opts = watchify.args; opts.debug = true; var bundler = watchify(browserify('./src/main', opts)); var bundle = compileBundle(bundler) bundler.on('update', bundle); return bundle(); }); function compileBundle(bundler) { return function() { var n = notifier('browserify'); return bundler .bundle() .on('error', n.error) .pipe(source('app.js')) .pipe(gulp.dest('dist')) .on('end', n.end); }; }