<commit_before>import gulp from 'gulp';
import changed from 'gulp-changed';
import babel from 'gulp-babel';
import config from './../configs/config';

gulp.task('babel-server', function babelServer() {
  return gulp
    .src(config.server.src)
    .pipe(changed(config.dest))
    .pipe(
      babel({
        sourceMaps: 'inline',
        presets: [
          'react',
          [
            'env',
            {
              targets: {
                node: 'current'
              }
            }
          ]
        ]
      })
    )
    .pipe(gulp.dest(config.dest));
});<commit_msg>[BUGFIX] - Issue #46 - server side babel resiliency<commit_after>import gulp from 'gulp';
import { log } from 'gulp-util';
import changed from 'gulp-changed';
import babel from 'gulp-babel';
import config from './../configs/config';

gulp.task('babel-server', function babelServer() {
  const babelStream = babel({
    sourceMaps: 'inline',
    presets: [
      'react',
      [
        'env',
        {
          targets: {
            node: 'current'
          }
        }
      ]
    ]
  });

  babelStream.on('error', function handleError(err) {
    log(`Error transpiling babel in gulp_babel_server task.`);
    log(err);
    babelStream.end();
  });

  return gulp
    .src(config.server.src)
    .pipe(changed(config.dest))
    .pipe(babelStream)
    .pipe(gulp.dest(config.dest));
});
{'fraction_non_alphanumeric': 0.14855072463768115, 'fraction_numerical': 0.0014492753623188406, 'mean_word_length': 2.002173913043478, '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': '3215767', 'n_tokens_mistral': 455, 'n_tokens_neox': 442, 'n_words': 91}