<commit_before>var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var spawn  = require('child_process').spawn;
$.del = require('del');
var config = require('./config.js')

var ts           = $.typescript;
var tsProject    = ts.createProject(config.tsConfigFile);
var failOnErrors = false;
$.ts = $.typescript;

// Require and Initialize browser sync with our configurtion
var browserSync  = require('browser-sync').create();

browserSync.init({
        server: {
            baseDir: config.htmlDir,
        },
        port: config.bsPort
});

var handleError = function(err) {
  if (failOnErrors) {
    $.util.log(err.message);
    process.exit(1);
  }
}

gulp.task('transpile-ts2js', function () {
  return tsProject.src()
                  .pipe($.ts(tsProject))
                  .on('error', handleError)
                  .js
                  .pipe(gulp.dest(config.tsOutDir));
});

gulp.task('default', function() {
   gulp.watch(config.tsFilesGlob, ['transpile-ts2js']);
   gulp.watch(config.htmlDir, browserSync.reload);
   gulp.watch(config.cssDir, browserSync.reload);
});<commit_msg>Rearranged gulpfile<commit_after>var gulp   = require('gulp');
var $      = require('gulp-load-plugins')();
var del    = require('del');
var config = require('./config.js')

$.ts  = $.typescript;
$.del = del;

var tsProject = $.ts.createProject(config.tsConfigFile);
var browserSync  = require('browser-sync').create();

var failOnErrors = false;
var handleError = function(err) {
  if (failOnErrors) {
    $.util.log(err.message);
    process.exit(1);
  }
}

gulp.task('transpile-ts2js', function () {
  return tsProject.src()
    .pipe($.ts(tsProject))
    .on('error', handleError)
    .js
    .pipe(gulp.dest(config.tsOutDir));
});

gulp.task('browser-sync', function() {
  browserSync.init({
    'server': {'baseDir': config.htmlDir},
    'port': config.bsPort
  });
});

gulp.task('default', function() {
   gulp.watch(config.tsFilesGlob, ['transpile-ts2js']);
   gulp.watch(config.htmlDir, browserSync.reload);
   gulp.watch(config.cssDir, browserSync.reload);
});

{'fraction_non_alphanumeric': 0.1774580335731415, 'fraction_numerical': 0.0028776978417266188, 'mean_word_length': 3.3823529411764706, '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': '3159197', 'n_tokens_mistral': 706, 'n_tokens_neox': 695, 'n_words': 122}