<commit_before>var gulp = require('gulp'),
    argv = require('yargs').argv,
    cache = require('gulp-cache'),
    concat = require('gulp-concat'),
    del = require('del'),
    gulpif = require('gulp-if'),
    gutil = require('gulp-util')
    notify = require('gulp-notify'),
    plumber = require('gulp-plumber'),
    q = require('q'),
    rename = require('gulp-rename'),
    replace = require('gulp-replace'),
    size = require('gulp-size');

var config = require('./package.json');
var settings = config.settings;
    settings.liveReload=false;
    settings.plumberConfig=function(){
      return {'errorHandler': onError};
    };

/**
 * browser-sync task for starting a server. This will open a browser for you. Point multiple browsers / devices to the same url and watch the magic happen.
 * Depends on: watch
 */
gulp.task('browser-sync', ['watch'], function() {
  var browserSync = require('browser-sync');

  // Watch any files in dist/*, reload on change
  gulp.watch([settings.dist + '**']).on('change', function(){browserSync.reload({});});

  return browserSync({
      server: {
          baseDir: settings.dist
      },
      ghostMode: {
        clicks: true,
        location: true,
        forms: true,
        scroll: true
      },
      open: "external",
      injectChanges: true, // inject CSS changes (false force a reload) 
      browser: ["google chrome"],
      scrollProportionally: true, // Sync viewports to TOP position
      scrollThrottle: 50,
    });
});


/**
 * Build and copy all styles, scripts, images and fonts.
 * Depends on: info, clean
 */
gulp.task('build', ['info', 'clean'], function() {
  gulp.start('styles', 'scripts', 'images', 'copy', 'todo');
});


/**
 * Cleans the `dist` folder and other generated files
 */
gulp.task('clean', ['clear-cache'],  function(cb) {
  del([settings.dist, 'todo.md', 'todo.json'], cb);
});<commit_msg>browser-sync optimization<commit_after>var gulp = require('gulp'),
    argv = require('yargs').argv,
    cache = require('gulp-cache'),
    concat = require('gulp-concat'),
    del = require('del'),
    gulpif = require('gulp-if'),
    gutil = require('gulp-util')
    notify = require('gulp-notify'),
    plumber = require('gulp-plumber'),
    q = require('q'),
    rename = require('gulp-rename'),
    replace = require('gulp-replace'),
    size = require('gulp-size');

var config = require('./package.json');
var settings = config.settings;
    settings.liveReload=false;
    settings.plumberConfig=function(){
      return {'errorHandler': onError};
    };

/**
 * browser-sync task for starting a server. This will open a browser for you. Point multiple browsers / devices to the same url and watch the magic happen.
 * Depends on: watch
 */
gulp.task('browser-sync', ['watch'], function() {
  var browserSync = require('browser-sync'),
  port = argv.port||settings.serverport;

  // Watch any files in dist/*, reload on change
  gulp.watch([settings.dist + '**']).on('change', function(){browserSync.reload({});});

  return browserSync({
      browser: ["google chrome"],
      ghostMode: {
        clicks: true,
        location: true,
        forms: true,
        scroll: true
      },
      injectChanges: true, // inject CSS changes (false force a reload) 
      logLevel: "info",
      open: false, // "local", "external", "ui"
      port: port,
      scrollProportionally: true, // Sync viewports to TOP position
      scrollThrottle: 50,
      server: {
          baseDir: settings.dist
      },
      ui: {
        port: port+1,
        weinre: {
            port: port+2
        }
      }
    });
});


/**
 * Build and copy all styles, scripts, images and fonts.
 * Depends on: info, clean
 */
gulp.task('build', ['info', 'clean'], function() {
  gulp.start('styles', 'scripts', 'images', 'copy', 'todo');
});


/**
 * Cleans the `dist` folder and other generated files
 */
gulp.task('clean', ['clear-cache'],  function(cb) {
  del([settings.dist, 'todo.md', 'todo.json'], cb);
});
{'fraction_non_alphanumeric': 0.16917670682730923, 'fraction_numerical': 0.0015060240963855422, 'mean_word_length': 3.0497967479674797, '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': '4347088', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1206, 'n_words': 332}