<commit_before>import gulp from 'gulp';
import del from 'del';
import paths from 'vinyl-paths';
import rev from 'gulp-rev';
import through from 'through2';
import webpack from 'gulp-webpack';
import { addToManifest } from './revision';
import './test';

const gen = (env) => {
  process.env.NODE_ENV = env;
  return webpack(require('../webpack.config')) // eslint-disable-line global-require
    .pipe(gulp.dest('www/js'));
};

gulp.task('clean-webpack', () => gulp.src(['./www/js/{bot,index}*'])
  .pipe(paths(del)));

gulp.task('webpack-gen-dev', ['clean-webpack', 'test'], () => gen('development'));
gulp.task('webpack-gen-prod', ['clean-webpack', 'test'], () => gen('production'));

gulp.task('webpack-dev', ['webpack-gen-dev'], () => gulp.src(['./www/js/*.js'])
  .pipe(rev())
  .pipe(through.obj(addToManifest))
  .pipe(gulp.dest('www/js')));

gulp.task('webpack-prod', ['webpack-gen-prod'], () => gulp.src(['./www/js/*.js'])
  .pipe(rev())
  .pipe(through.obj(addToManifest))
  .pipe(gulp.dest('www/js')));
<commit_msg>Fixed the bundle revision<commit_after>import gulp from 'gulp';
import del from 'del';
import paths from 'vinyl-paths';
import rev from 'gulp-rev';
import through from 'through2';
import webpack from 'gulp-webpack';
import { addToManifest } from './revision';
import './test';

const gen = (env) => {
  process.env.NODE_ENV = env;
  return webpack(require('../webpack.config')) // eslint-disable-line global-require
    .pipe(gulp.dest('www/js'));
};

const addRev = () => gulp.src(['./www/js/{bot,index}.js'])
  .pipe(rev())
  .pipe(through.obj(addToManifest))
  .pipe(gulp.dest('www/js'));

gulp.task('clean-webpack', () => gulp.src(['./www/js/{bot,index}*'])
  .pipe(paths(del)));

gulp.task('webpack-gen-dev', ['clean-webpack', 'test'], () => gen('development'));
gulp.task('webpack-gen-prod', ['clean-webpack', 'test'], () => gen('production'));
gulp.task('webpack-dev', ['webpack-gen-dev'], addRev);
gulp.task('webpack-prod', ['webpack-gen-prod'], addRev);

{'fraction_non_alphanumeric': 0.2458521870286576, 'fraction_numerical': 0.001005530417295123, 'mean_word_length': 4.887573964497041, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, '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': '6367804', 'n_tokens_mistral': 704, 'n_tokens_neox': 704, 'n_words': 129}