var browserify = require('browserify');
var gulp = require('gulp');
var handleErrors = require('../util/handle-errors');
var source = require('vinyl-source-stream');

function createSingleBundle (options) {
    browserify({
        entries: options.input,
        extensions: options.extensions
    })
        .bundle({debug: true})
        .on('error', handleErrors)
        .pipe(source(options.output))
        .pipe(gulp.dest(options.destination));
}

function createBundles (bundles) {
    bundles.forEach(function (bundle) {
        createSingleBundle({
            input: bundle.input,
            output: bundle.output,
            extensions: bundle.extensions,
            destination: bundle.destination
        });
    });
}

gulp.task('browserify', function () {
    createBundles([
        {
            input: ['./client/javascript/home.js'],
            output: 'home.js',
            extensions: ['.handlebars'],
            destination: './client/public/javascript/'
        },
        {
            input: ['./client/javascript/profile.js'],
            output: 'profile.js',
            extensions: ['.handlebars'],
            destination: './client/public/javascript/'
        }
    ]);
});
@@ -886,49 +886,8 @@
 s',%0A
-            extensions: %5B'.handlebars'%5D,%0A
     
@@ -1135,32 +1135,205 @@
 ic/javascript/'%0A
+        %7D,%0A        %7B%0A            input: %5B'./client/javascript/profile-new.js'%5D,%0A            output: 'profile-new.js',%0A            destination: './client/public/javascript/'%0A
         %7D%0A    %5D)

add new react profile to browserify task