<commit_before>/* browserify task
	 ---------------
	 Bundle javascripty things with browserify!

	 This task is set up to generate multiple separate bundles, from
	 different sources, and to use Watchify when run from the default task.

	 See browserify.bundleConfigs in gulp/config.js
*/

var browserify   = require('browserify');
var buffer       = require('vinyl-buffer');
var bundleLogger = require('../util/bundleLogger');
var config       = require('../config').browserify;
var gulp         = require('gulp');
var handleErrors = require('../util/handleErrors');
var source       = require('vinyl-source-stream');
var sourcemaps   = require('gulp-sourcemaps');
var uglify       = require('gulp-uglify');
var watchify     = require('watchify');
var to5Browserify = require('6to5-browserify');

gulp.task('browserify', function(callback) {
	var bundleQueue = config.bundleConfigs.length;

	var browserifyThis = function(bundleConfig) {
		var bundler = browserify({
			// Required watchify args
			cache: {}, packageCache: {}, fullPaths: true,
			// Specify the entry point of your app
			entries: bundleConfig.entries,
			// Add file extentions to make optional in your requires
			extensions: config.extensions,
			// Enable source maps!
			debug: config.debug,
		});

		bundler.transform(to5Browserify);

		var bundle = function() {
			// Log when bundling starts
			bundleLogger.start(bundleConfig.outputName);

			return bundler
				.bundle()
				// Report compile errors
				.on('error', handleErrors)
				// Use vinyl-source-stream to make the
				// stream gulp compatible. Specifiy the
				// desired output filename here.
				.pipe(source(bundleConfig.outputName))
				// Turn on sourcemaps
				.pipe(buffer())
				.pipe(sourcemaps.init({loadMaps: true}))
				.pipe(uglify())
				.pipe(sourcemaps.write('.'))
				// Specify the output destination
				.pipe(gulp.dest(bundleConfig.dest))
				.on('end', reportFinished);
		};

		if (global.isWatching) {
			// Wrap with watchify and rebundle on changes
			bundler = watchify(bundler);
			// Rebundle on update
			bundler.on('update', bundle);
		}

		var reportFinished = function() {
			// Log when bundling completes
			bundleLogger.end(bundleConfig.outputName)

			if (bundleQueue) {
				bundleQueue--;
				if (bundleQueue === 0) {
					// If queue is empty, tell gulp the task is complete.
					// https://github.com/gulpjs/gulp/blob/master/docs/API.md#accept-a-callback
					callback();<commit_msg>But don't use them right now.<commit_after>/* browserify task
	 ---------------
	 Bundle javascripty things with browserify!

	 This task is set up to generate multiple separate bundles, from
	 different sources, and to use Watchify when run from the default task.

	 See browserify.bundleConfigs in gulp/config.js
*/

var browserify   = require('browserify');
var buffer       = require('vinyl-buffer');
var bundleLogger = require('../util/bundleLogger');
var config       = require('../config').browserify;
var gulp         = require('gulp');
var handleErrors = require('../util/handleErrors');
var source       = require('vinyl-source-stream');
var sourcemaps   = require('gulp-sourcemaps');
var uglify       = require('gulp-uglify');
var watchify     = require('watchify');
var to5Browserify = require('6to5-browserify');

gulp.task('browserify', function(callback) {
	var bundleQueue = config.bundleConfigs.length;

	var browserifyThis = function(bundleConfig) {
		var bundler = browserify({
			// Required watchify args
			cache: {}, packageCache: {}, fullPaths: true,
			// Specify the entry point of your app
			entries: bundleConfig.entries,
			// Add file extentions to make optional in your requires
			extensions: config.extensions,
			// Enable source maps!
			debug: config.debug,
		});

		bundler.transform(to5Browserify);

		var bundle = function() {
			// Log when bundling starts
			bundleLogger.start(bundleConfig.outputName);

			return bundler
				.bundle()
				// Report compile errors
				.on('error', handleErrors)
				// Use vinyl-source-stream to make the
				// stream gulp compatible. Specifiy the
				// desired output filename here.
				.pipe(source(bundleConfig.outputName))
				// Turn on sourcemaps
				// .pipe(buffer())
				// .pipe(sourcemaps.init({loadMaps: true}))
				// .pipe(uglify())
				// .pipe(sourcemaps.write('.'))
				// Specify the output destination
				.pipe(gulp.dest(bundleConfig.dest))
				.on('end', reportFinished);
		};

		if (global.isWatching) {
			// Wrap with watchify and rebundle on changes
			bundler = watchify(bundler);
			// Rebundle on update
			bundler.on('update', bundle);
		}

		var reportFinished = function() {
			// Log when bundling completes
			bundleLogger.end(bundleConfig.outputName)

			if (bundleQueue) {
				bundleQueue--;
				if (bundleQueue === 0) {
					// If queue is empty, tell gulp the task is complete.
					// https://github.com/gulpjs/gulp/blob/master/docs/API.md#accept-a-callback
					callback();
{'fraction_non_alphanumeric': 0.1303996770286637, 'fraction_numerical': 0.0020185708518368995, 'mean_word_length': 3.195596951735817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5866640', 'n_tokens_mistral': 1682, 'n_tokens_neox': 1418, 'n_words': 404}