<commit_before>var gulp = require('gulp');
var mirror = require('gulp-mirror');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');

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

function rebundle(bundler) {
    var bundle = bundler.bundle()
        .on('error', handleErrors.handler)
        .pipe(handleErrors())
        .pipe(source(paths.outBasename))
        .pipe(buffer());

    var dev = sourcemaps.init({loadMaps: true});
    dev.pipe(sourcemaps.write('./', {sourceRoot: './'}))
        .pipe(gulp.dest(paths.out));

    var min = rename({ suffix: '.min' })
    min.pipe(sourcemaps.init({loadMaps: true}))
        .pipe(uglify())
        .pipe(sourcemaps.write('./', {sourceRoot: './', addComment: false}))
        .pipe(gulp.dest(paths.out));

    return bundle.pipe(mirror(dev, min));
}<commit_msg>add uglify compress options(fireball-x/engine-framework#5)<commit_after>var gulp = require('gulp');
var mirror = require('gulp-mirror');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');

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

function rebundle(bundler) {
    var bundle = bundler.bundle()
        .on('error', handleErrors.handler)
        .pipe(handleErrors())
        .pipe(source(paths.outBasename))
        .pipe(buffer());

    var dev = sourcemaps.init({loadMaps: true});
    dev.pipe(sourcemaps.write('./', {sourceRoot: './'}))
        .pipe(gulp.dest(paths.out));

    var min = rename({ suffix: '.min' })
    min.pipe(sourcemaps.init({loadMaps: true}))
        .pipe(uglify({
            compress: {
                global_defs : {
                    FIRE_IS_DEBUG: false,
                    FIRE_IS_DEV: false,
                    FIRE_IS_EDITOR: false
                }
            }
        }))
        .pipe(sourcemaps.write('./', {sourceRoot: './', addComment: false}))
        .pipe(gulp.dest(paths.out));

    return bundle.pipe(mirror(dev, min));
}
{'fraction_non_alphanumeric': 0.17675438596491228, 'fraction_numerical': 0.0004385964912280702, 'mean_word_length': 3.0229276895943564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1414220', 'n_tokens_mistral': 721, 'n_tokens_neox': 700, 'n_words': 131}