<commit_before>'use strict';

var DEV_MODE = process.env.CLIENT === 'dev';

var lie = require('lie');
if (typeof Promise === 'undefined') {
  global.Promise = lie; // required for denodeify in node 0.10
}
var path = require('path');
var denodeify = require('denodeify');
var browserify = require('browserify');
var browserifyIncremental = require('browserify-incremental');
var derequire = require('derequire');
var fs = require('fs');
var writeFileAsync = denodeify(fs.writeFile);
var renameAsync = denodeify(fs.rename);
var streamToPromise = require('stream-to-promise');

var UglifyJS = require("uglify-js");

function addPath(pkgName, otherPath) {
  return path.resolve('packages/node_modules/' + pkgName, otherPath);
}

function writeFile(filename, contents) {
  var tmp = filename + '.tmp';
  return writeFileAsync(tmp, contents, 'utf-8').then(function () {
    return renameAsync(tmp, filename);
  }).then(function () {
    console.log('  \u2713' + ' wrote ' +
      filename.match(/packages[/\\]node_modules[/\\]\S*?[/\\].*/)[0]);
  });
}

function doUglify(pkgName, code, prepend, fileOut) {
  var miniCode = prepend + UglifyJS.minify(code);<commit_msg>(#6951) - Fix minified build<commit_after>'use strict';

var DEV_MODE = process.env.CLIENT === 'dev';

var lie = require('lie');
if (typeof Promise === 'undefined') {
  global.Promise = lie; // required for denodeify in node 0.10
}
var path = require('path');
var denodeify = require('denodeify');
var browserify = require('browserify');
var browserifyIncremental = require('browserify-incremental');
var derequire = require('derequire');
var fs = require('fs');
var writeFileAsync = denodeify(fs.writeFile);
var renameAsync = denodeify(fs.rename);
var streamToPromise = require('stream-to-promise');

var UglifyJS = require("uglify-js");

function addPath(pkgName, otherPath) {
  return path.resolve('packages/node_modules/' + pkgName, otherPath);
}

function writeFile(filename, contents) {
  var tmp = filename + '.tmp';
  return writeFileAsync(tmp, contents, 'utf-8').then(function () {
    return renameAsync(tmp, filename);
  }).then(function () {
    console.log('  \u2713' + ' wrote ' +
      filename.match(/packages[/\\]node_modules[/\\]\S*?[/\\].*/)[0]);
  });
}

function doUglify(pkgName, code, prepend, fileOut) {
  var miniCode = prepend + UglifyJS.minify(code).code;
{'fraction_non_alphanumeric': 0.1727815699658703, 'fraction_numerical': 0.00938566552901024, 'mean_word_length': 4.966921119592875, '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': '721099', 'n_tokens_mistral': 783, 'n_tokens_neox': 758, 'n_words': 174}