<commit_before>'use strict';

const babel = require('gulp-babel');
const envify = require('gulp-envify');
const gulp = require('gulp');
const gzip = require('gulp-gzip');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const uglify = require('gulp-uglify');

const brotli = require('gulp-brotli');
const zopfli = require('gulp-zopfli');
const clone = require('gulp-clone');
const es = require('event-stream')

function build(options) {
    let baseStream = gulp.src('./src/onfontready.js')
        .pipe(replace('module.exports', 'window.onfontready'))
        .pipe(envify({
            isLegacy: options.isLegacy || false,
            isTest: options.isTest || false,
        }))
        .pipe(babel({
            plugins: [
                'check-es2015-constants',
                'transform-es2015-block-scoping',
                'transform-es2015-arrow-functions',
                'transform-node-env-inline',
                'transform-dead-code-elimination',
            ],
        }));
        
    if (options.isLegacy)
    {
        baseStream = baseStream.pipe(rename((path) => { path.basename += '.legacy' }));
    }

    baseStream = baseStream.pipe(gulp.dest(options.dest));
<commit_msg>Updated gulpfile<commit_after>'use strict';

const babel = require('gulp-babel');
const brotli = require('gulp-brotli');
const clone = require('gulp-clone');
const envify = require('gulp-envify');
const es = require('event-stream');
const gulp = require('gulp');
const gzip = require('gulp-gzip');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const uglify = require('gulp-uglify');
const zopfli = require('gulp-zopfli');

function build(options) {
    let baseStream = gulp.src('./src/onfontready.js')
        .pipe(replace('module.exports', 'window.onfontready'))
        .pipe(envify({
            isLegacy: options.isLegacy || false,
            isTest: options.isTest || false,
        }))
        .pipe(babel({
            plugins: [
                'check-es2015-constants',
                'transform-es2015-block-scoping',
                'transform-es2015-arrow-functions',
                'transform-node-env-inline',
                'transform-dead-code-elimination',
            ],
        }));
        
    if (options.isLegacy)
    {
        baseStream = baseStream.pipe(rename((path) => { path.basename += '.legacy' }));
    }

    baseStream = baseStream.pipe(gulp.dest(options.dest));

{'fraction_non_alphanumeric': 0.15985430999595304, 'fraction_numerical': 0.00971266693646297, 'mean_word_length': 2.5982532751091703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4955377', 'n_tokens_mistral': 789, 'n_tokens_neox': 764, 'n_words': 129}