<commit_before>'use strict';

var scriptsTask = function (gulp, plugins, config, helpers) {
  function buildScript(watch) {
    var props = {
      entries: config.src.app,
      debug: true,
      transform: [["babelify", { "presets": ["es2015"] }]]
    };

    var bundler = watch ? plugins.watchify(plugins.browserify(props)) : plugins.browserify(props);

    function rebundle() {
      var stream = bundler.bundle();
      return stream
        .on('error', helpers.onError)
        .pipe(plugins.vinylSourceStream('bundle.js'))
        .pipe(plugins.vinylBuffer())
        .pipe(plugins.sourcemaps.init({loadMaps: true}))
        .pipe(plugins.uglify())
        .pipe(plugins.sourcemaps.write('./'))
        .pipe(gulp.dest(config.dest.scripts))
        .pipe(plugins.browserSync.stream());
    }

    bundler.on('update', () => {
      rebundle();
    })

    return rebundle();
  }

  gulp.task('scripts', () => {
      return buildScript(false);
  });

  gulp.task('watchify', ['scripts'], () => {
    return buildScript(true);
  });
};

module.exports = scriptsTask;<commit_msg>Added Yeaman feature detection<commit_after>'use strict';

var scriptsTask = function (gulp, plugins, config, helpers) {
  function buildScript(watch) {
    var props = {
      entries: config.src.app,
      debug: true,
      <% if(features.has_babel) { %>
      transform: [["babelify", { "presets": ["es2015"] }]]
      <% } %>
    };

    var bundler = watch ? plugins.watchify(plugins.browserify(props)) : plugins.browserify(props);

    function rebundle() {
      var stream = bundler.bundle();
      return stream
        .on('error', helpers.onError)
        .pipe(plugins.vinylSourceStream('bundle.js'))
        .pipe(plugins.vinylBuffer())
        .pipe(plugins.sourcemaps.init({loadMaps: true}))
        .pipe(plugins.uglify())
        .pipe(plugins.sourcemaps.write('./'))
        .pipe(gulp.dest(config.dest.scripts))
        .pipe(plugins.browserSync.stream());
    }

    bundler.on('update', rebundle);

    return rebundle();
  }

  gulp.task('scripts', () => buildScript(false));
  gulp.task('watchify', ['scripts'], () => buildScript(true));
};

module.exports = scriptsTask;
{'fraction_non_alphanumeric': 0.17453046266605587, 'fraction_numerical': 0.0036646816307833257, 'mean_word_length': 2.978142076502732, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 10, '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': '5518017', 'n_tokens_mistral': 697, 'n_tokens_neox': 667, 'n_words': 113}