var source     = require('vinyl-source-stream'),
    streamify  = require('gulp-streamify'),
    browserify = require('browserify'),
    uglify     = require('gulp-uglify'),
    rename     = require('gulp-rename'),
    gulp       = require('gulp');

var baseDir = './';
var baseFileName = 'array-keys';
var objName  = 'ArrayKeys';

gulp.task('default', function() {
  var bundleStream = browserify(baseDir + baseFileName + '.js', { standalone: objName }).bundle();

  return bundleStream
         .pipe(source(baseDir + baseFileName + '.js'))
         .pipe(gulp.dest('./browser'))
         .pipe(streamify(uglify()))
         .pipe(rename(baseFileName + '.min.js'))
         .pipe(gulp.dest('./browser'));
});
var source     = require('vinyl-source-stream'),
    streamify  = require('gulp-streamify'),
    browserify = require('browserify'),
    uglify     = require('gulp-uglify'),
    rename     = require('gulp-rename'),
    gulp       = require('gulp');

var baseDir = './';
var baseFileName = 'array-keys';
var objName  = 'ArrayKeys';

gulp.task('default', function() {
  var bundleStream = browserify(baseDir + baseFileName + '.js', { standalone: objName }).bundle();

  return bundleStream
         .pipe(source(baseFileName + '.js'))
         .pipe(gulp.dest('./browser'))
         .pipe(streamify(uglify()))
         .pipe(rename(baseFileName + '.min.js'))
         .pipe(gulp.dest('./browser'));
});

tweak build process