<commit_before>'use strict';

var gulp = require('gulp');
var browserify = require('browserify');
var gutil = require('gulp-util');
var uglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var streamify = require('gulp-streamify');
var minifyHTML = require('gulp-minify-html');
var browserSync = require('browser-sync');
var karma = require('karma').server;
var less = require('gulp-less');

var libs = [
    'jquery',
    'crossroads',
    'ractive',
    'hasher',
    'lodash',
    'preconditions',
    'signals',
    'rsvp'
];

var paths = {
    js: {
        src: './client/js/app.es6',
        dest: './dist/js/',
        watch: ['./client/**/*.es6', './client/**/*.ract']
    },
    html: {
        src: './client/index.html',
        dest: './dist/'
    },
    less: {
        src: './client/css/styles.less',
        dest: './dist/css/'
    },
    test: {
        watch: ['./client/**/*.es6', './client/**/*.ract', './test/unit/**/*.es6']
    }
};

gulp.task('vendor', function () {
    var b = browserify({
        debug: true,
        insertGlobals: true,
        require: libs
    });

    b.require('./client/js/lib/semantic.js', {expose: 'semantic', depends: 'jquery'});

    return b.bundle()
        .on('error', gutil.log)
        .pipe(source('vendors.js'))
        .pipe(streamify(uglify()))
        .pipe(gulp.dest(paths.js.dest));
});

gulp.task('minify-html', function () {
    return gulp.src(paths.html.src)
        .pipe(minifyHTML())
        .pipe(gulp.dest(paths.html.dest));
});

gulp.task('less', function () {
    return gulp.src(paths.less.src)
        .pipe(less())
        .pipe(gulp.dest(paths.less.dest));
});

gulp.task('build', function () {
    var ractivate = require('ractivate');
    var babelify = require('babelify');
    var b = browserify({
        debug: true,
        insertGlobals: true
    });

    b.external('semantic');<commit_msg>refactor(gulp): added a var for third party libraries<commit_after>'use strict';

var gulp = require('gulp');
var browserify = require('browserify');
var gutil = require('gulp-util');
var uglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var streamify = require('gulp-streamify');
var minifyHTML = require('gulp-minify-html');
var browserSync = require('browser-sync');
var karma = require('karma').server;
var less = require('gulp-less');

var libs = [
    'jquery',
    'crossroads',
    'ractive',
    'hasher',
    'lodash',
    'preconditions',
    'signals',
    'rsvp'
];

var thirdPartyLibs = [
    {file: './client/js/lib/semantic.js', opts: {expose: 'semantic'}}
];

var paths = {
    js: {
        src: './client/js/app.es6',
        dest: './dist/js/',
        watch: ['./client/**/*.es6', './client/**/*.ract']
    },
    html: {
        src: './client/index.html',
        dest: './dist/'
    },
    less: {
        src: './client/css/styles.less',
        dest: './dist/css/'
    },
    test: {
        watch: ['./client/**/*.es6', './client/**/*.ract', './test/unit/**/*.es6']
    }
};

gulp.task('vendor', function () {
    var b = browserify({
        debug: true,
        insertGlobals: true,
        require: libs
    });

    thirdPartyLibs.forEach(function(lib) {
        b.require(lib.file, lib.opts);
    });

    return b.bundle()
        .on('error', gutil.log)
        .pipe(source('vendors.js'))
        .pipe(streamify(uglify()))
        .pipe(gulp.dest(paths.js.dest));
});

gulp.task('minify-html', function () {
    return gulp.src(paths.html.src)
        .pipe(minifyHTML())
        .pipe(gulp.dest(paths.html.dest));
});

gulp.task('less', function () {
    return gulp.src(paths.less.src)
        .pipe(less())
        .pipe(gulp.dest(paths.less.dest));
});

gulp.task('build', function () {
    var ractivate = require('ractivate');
    var babelify = require('babelify');
    var b = browserify({
        debug: true,
        insertGlobals: true
    });

    thirdPartyLibs.forEach(function(lib) {
        b.external(lib.file);
    });

{'fraction_non_alphanumeric': 0.20733532934131738, 'fraction_numerical': 0.001996007984031936, 'mean_word_length': 2.504370629370629, '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': '5120353', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1392, 'n_words': 248}