<commit_before>'use strict';

var gulp = require('gulp');
var connect = require('gulp-connect');
var livereload = require('gulp-livereload');
var browserify = require('browserify');
var del = require('del');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var reactify = require('reactify');

// load plugins
var $ = require('gulp-load-plugins')();

var isDev = true;
var isProd = false;

gulp.task('styles', function () {
    return gulp.src('app/styles/main.less')
        .pipe($.if(isDev, $.sourcemaps.init()))
        .pipe($.less())
        .pipe($.autoprefixer('last 1 version'))
        .pipe($.if(isDev, $.sourcemaps.write()))
        .pipe($.if(isDev, gulp.dest('.tmp/styles')))
        .pipe($.if(isProd, $.csso()))
        .pipe($.if(isProd, gulp.dest('dist/styles')))
        .pipe($.size())
        .pipe(livereload());
});

gulp.task('scripts', function() {
    var bundler = browserify('./app/scripts/main.js', {debug: isDev});
    bundler.transform(reactify);

    var stream = bundler.bundle();

    return stream
        .pipe(source('bundle.js'))
        .pipe($.if(isDev, gulp.dest('.tmp/scripts')))
        .pipe($.if(isProd, buffer()))
        .pipe($.if(isProd, $.uglify()))
        .pipe($.if(isProd, gulp.dest('dist/scripts')))
        .pipe(livereload())
        .on('error', $.util.log);
});

gulp.task('html', ['styles', 'scripts'], function () {
    return gulp.src('app/*.html')
        .pipe($.preprocess())
        //.pipe($.useref.assets({searchPath: 'dist'}))
        //.pipe($.useref())
        .pipe(gulp.dest('dist'))
        .pipe($.size())
        .pipe(livereload());
});

gulp.task('images', function () {
    return gulp.src('app/images/**/*')
        .pipe(gulp.dest('dist/images'))
        .pipe($.size());
});

gulp.task('fonts', function () {
    return gulp.src('node_modules/font-awesome/fonts/*')
        .pipe($.filter('**/*.{eot,svg,ttf,woff}'))
        .pipe($.flatten())
        .pipe($.if(isDev, gulp.dest('.tmp/fonts')))
        .pipe($.if(isProd, gulp.dest('dist/fonts')))
        .pipe($.size());
});

gulp.task('extras', function () {
    return gulp.src(['app/*.*', '!app/*.html'], { dot: true })
        .pipe(gulp.dest('dist'));
});

gulp.task('clean', function () {
    return del(['.tmp', 'dist']);
});

gulp.task('production', ['html', 'images', 'fonts', 'extras']);

gulp.task('build', function () {
    isDev = false;
    isProd = true;
    gulp.start('production');
});
<commit_msg>copy woff2 static files as well in font task<commit_after>'use strict';

var gulp = require('gulp');
var connect = require('gulp-connect');
var livereload = require('gulp-livereload');
var browserify = require('browserify');
var del = require('del');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var reactify = require('reactify');

// load plugins
var $ = require('gulp-load-plugins')();

var isDev = true;
var isProd = false;

gulp.task('styles', function () {
    return gulp.src('app/styles/main.less')
        .pipe($.if(isDev, $.sourcemaps.init()))
        .pipe($.less())
        .pipe($.autoprefixer('last 1 version'))
        .pipe($.if(isDev, $.sourcemaps.write()))
        .pipe($.if(isDev, gulp.dest('.tmp/styles')))
        .pipe($.if(isProd, $.csso()))
        .pipe($.if(isProd, gulp.dest('dist/styles')))
        .pipe($.size())
        .pipe(livereload());
});

gulp.task('scripts', function() {
    var bundler = browserify('./app/scripts/main.js', {debug: isDev});
    bundler.transform(reactify);

    var stream = bundler.bundle();

    return stream
        .pipe(source('bundle.js'))
        .pipe($.if(isDev, gulp.dest('.tmp/scripts')))
        .pipe($.if(isProd, buffer()))
        .pipe($.if(isProd, $.uglify()))
        .pipe($.if(isProd, gulp.dest('dist/scripts')))
        .pipe(livereload())
        .on('error', $.util.log);
});

gulp.task('html', ['styles', 'scripts'], function () {
    return gulp.src('app/*.html')
        .pipe($.preprocess())
        //.pipe($.useref.assets({searchPath: 'dist'}))
        //.pipe($.useref())
        .pipe(gulp.dest('dist'))
        .pipe($.size())
        .pipe(livereload());
});

gulp.task('images', function () {
    return gulp.src('app/images/**/*')
        .pipe(gulp.dest('dist/images'))
        .pipe($.size());
});

gulp.task('fonts', function () {
    return gulp.src('node_modules/font-awesome/fonts/*')
        .pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}'))
        .pipe($.flatten())
        .pipe($.if(isDev, gulp.dest('.tmp/fonts')))
        .pipe($.if(isProd, gulp.dest('dist/fonts')))
        .pipe($.size());
});

gulp.task('extras', function () {
    return gulp.src(['app/*.*', '!app/*.html'], { dot: true })
        .pipe(gulp.dest('dist'));
});

gulp.task('clean', function () {
    return del(['.tmp', 'dist']);
});

gulp.task('production', ['html', 'images', 'fonts', 'extras']);

gulp.task('build', function () {
    isDev = false;
    isProd = true;
    gulp.start('production');
});

{'fraction_non_alphanumeric': 0.2426602756141402, 'fraction_numerical': 0.000798881565807869, 'mean_word_length': 3.0160384923817163, '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': '6567542', 'n_tokens_mistral': 1775, 'n_tokens_neox': 1742, 'n_words': 280}