<commit_before>'use strict';

const gulp = require('gulp');
const babel = require('gulp-babel');
const webpack = require('gulp-webpack');
const rename = require('gulp-rename');
const uglifyjs = require('gulp-uglifyjs');

gulp.task('default', () => {
  return gulp
    .start('build')
    .start('build:browser');
});

gulp.task('build', () => {
  return gulp.src('src/**')
    .pipe(babel({
        presets: ['es2015']
    }))
    .pipe(gulp.dest('lib'));
});

gulp.task('build:browser', () => {
  return gulp.src('src/**')
    .pipe(webpack(require('./webpack.config')))
    .pipe(gulp.dest('./dist'))
    .pipe(rename(path => path.extname = ".min.js"))
    .pipe(uglifyjs())
    .pipe(gulp.dest('./dist'));
});

gulp.task('watch', () => {
  return gulp.watch('src/*.js', e => {
    if (e.type === 'changed') {
      console.log(`${e.path} changed, building...`);
      
      gulp.src(e.path)
        .pipe(babel({ presets: ['es2015'] }))
        .pipe(gulp.dest('lib'));
    }
  });
})<commit_msg>update gulpfile.js<commit_after>'use strict';

const gulp = require('gulp');
const babel = require('gulp-babel');
const webpack = require('gulp-webpack');
const rename = require('gulp-rename');
const uglifyjs = require('gulp-uglifyjs');

gulp.task('default', () => {
  return gulp
    .start('build')
    .start('build:browser');
});

gulp.task('build', () => {
  return gulp.src('src/**')
    .pipe(babel({
        presets: ['es2015']
    }))
    .pipe(gulp.dest('lib'));
});

gulp.task('build:browser', () => {
  return gulp.src('src/**')
    .pipe(webpack(require('./webpack.config')))
    .pipe(gulp.dest('./dist'))
    .pipe(rename(path => path.extname = ".min.js"))
    .pipe(uglifyjs())
    .pipe(gulp.dest('./dist'));
});

gulp.task('watch', () => {
  return gulp.watch('src/*.js', e => {
    if (e.type === 'changed') {
      console.log(`${e.path} changed, building...`);
      
      gulp.src(e.path)
        .pipe(babel({ presets: ['es2015'], highlightCode: false, }).on('error', err => console.error(err)))
        .pipe(gulp.dest('lib'));
    }
  });
})
{'fraction_non_alphanumeric': 0.2539912917271408, 'fraction_numerical': 0.0077406869859700045, 'mean_word_length': 3.2551440329218106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '5057511', 'n_tokens_mistral': 772, 'n_tokens_neox': 755, 'n_words': 114}