Created
April 25, 2017 10:25
-
-
Save monjer/085ee06f22d0cf5cf9998bd5aaa8040f to your computer and use it in GitHub Desktop.
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'), | |
| source = require('vinyl-source-stream'), | |
| rename = require('gulp-rename'), | |
| browserify = require('browserify'), | |
| es = require('event-stream'); | |
| gulp.task('default', function() { | |
| // set entry files | |
| var files = [ | |
| './app/entry-a.js', | |
| './app/entry-b.js' | |
| ]; | |
| // map them to streams | |
| var tasks = files.map(function(entry) { | |
| return browserify({ entries: [entry] }) | |
| .bundle() | |
| .pipe(source(entry)) | |
| .pipe(rename({ | |
| extname: '.bundle.js' | |
| })) | |
| .pipe(gulp.dest('./dist')); | |
| }); | |
| // merge | |
| return es.merge.apply(null, tasks); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment