gulpfile.js
function bundleProduction() {
    return browserify(browersifyOptions)
    .transform(babelify.configure(babelifyOptions))
    .transform(envify({ _: 'purge', NODE_ENV: 'production' }), { global: true })
    .on('log', gutil.log)
    .bundle()

    // minify
    .pipe(source('crudl.js'))
    .pipe(buffer())
    .pipe(uglify())
    .pipe(rename('crudl.min.js'))
    .on('error', gutil.log.bind(gutil, 'uglify:'))

    // Prepend the license
    .pipe(concat('crudl.min.js'))
    .pipe(concat.header(`/* LICENSE: ${packageJSON.license} */\n`))

    // Copy to dist
    .pipe(gulp.dest(dist))

    .on('end', () => {
        gutil.log(`Successfully build ${gutil.colors.magenta(`${dist}/crudl.min.js`)}`)
    })
}
function bundleProduction() {
    return browserify(browersifyOptions)
    .transform(babelify.configure(babelifyOptions))
    .transform(envify({ _: 'purge', NODE_ENV: 'production' }), { global: true })
    .on('log', gutil.log)
    .bundle()

    // minify
    .pipe(source('crudl.js'))
    .pipe(buffer())
    .pipe(uglify())
    .pipe(rename('crudl.min.js'))
    .on('error', gutil.log.bind(gutil, 'uglify:'))

    // Prepend the license
    .pipe(concat('crudl.min.js'))
    .pipe(concat.header(`/* LICENSE: ${packageJSON.license} */\n`))

    // Copy to dist
    .pipe(gulp.dest(dist))

    .on('end', () => {
        gutil.log(`Successfully build ${gutil.colors.magenta(`${dist}/crudl.min.js`)}`)
    })
}
function bundleProduction ( ) { return browserify ( browersifyOptions ) . transform ( babelify . configure ( babelifyOptions ) ) . transform ( envify ( { _ : 'purge' , NODE_ENV : 'production' } ) , { global : true } ) . on ( 'log' , gutil . log ) . bundle ( ) // minify . pipe ( source ( 'crudl.js' ) ) . pipe ( buffer ( ) ) . pipe ( uglify ( ) ) . pipe ( rename ( 'crudl.min.js' ) ) . on ( 'error' , gutil . log . bind ( gutil , 'uglify:' ) ) // Prepend the license . pipe ( concat ( 'crudl.min.js' ) ) . pipe ( concat . header ( ` ${ packageJSON . license } \n ` ) ) // Copy to dist . pipe ( gulp . dest ( dist ) ) . on ( 'end' , ( ) => { gutil . log ( ` ${ gutil . colors . magenta ( ` ${ dist } ` ) } ` ) } ) }
Bundle task for the production environment
Bundle task for the production environment