<commit_before>var gulp = require('gulp'),
  livereload = require('gulp-livereload'),
  browserify = require('browserify'),
  source = require('vinyl-source-stream'),
  minifyHTML = require('gulp-minify-html'),
  less = require('gulp-less'),
  minifyCSS = require('gulp-minify-css'),
  concat = require('gulp-concat'),
  uglify = require('gulp-uglify'),
  rename = require("gulp-rename");

gulp.task('express', function() {
  require('./app');
});

gulp.task('browserify', function() {
  return browserify({
      entries: ['src/index.jsx'],
      debug: true,
      insertGlobals: true,
      cache: {},
      packageCache: {},
      fullPaths: true,
      transform: ['reactify']
    })
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulp.dest('./public/'))
    .pipe(livereload());
});

gulp.task('minify-html', function() {
  var opts = {
    conditionals: true,
    spare: true
  };

  return gulp.src('./src/*.html')
    .pipe(minifyHTML({
      conditionals: true,
      spare: true
    }))
    .pipe(gulp.dest('./public/'))
    .pipe(livereload());
});

gulp.task('semantic-conf', function() {
  return gulp.src(['./bower_components/semantic-ui/src/theme.config.example'])
    .pipe(rename('theme.config'))
    .pipe(gulp.dest('./bower_components/semantic-ui/src/'));
});

gulp.task('less', ['semantic-conf'], function() {
  return gulp.src('./src/index.less')
    //plumber
    .pipe(less({
      // paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(minifyCSS())
    .pipe(gulp.dest('./public'))
    .pipe(livereload());
});

gulp.task('images', function() {
  return gulp.src(['./src/*.jpg', './src/*.png'], {
      base: './src'
    })
    .pipe(gulp.dest('./public'));
});

gulp.task('js-libs', function() {
  return gulp.src([
      'bower_components/jquery/dist/jquery.min.js',
      'bower_components/semantic-ui/dist/semantic.min.js'
    ])
    .pipe(concat('dependencies.js', {
      newLine: ';\n'
    }))
    // .pipe(uglify({
    //   mangle: false,
    //   compress: false
    // }))
    .pipe(gulp.dest('public'));
});


gulp.task('default', ['images', 'browserify', 'less', 'js-libs', 'minify-html']);

gulp.task('run', ['express', 'default'], function() {
  livereload.listen();
  gulp.watch('src/*.js*', ['browserify']);
  gulp.watch('src/*.less', ['less']);
  gulp.watch('src/*.html', ['minify-html']);
});<commit_msg>Removes source map on prod<commit_after>var gulp = require('gulp'),
  livereload = require('gulp-livereload'),
  browserify = require('browserify'),
  source = require('vinyl-source-stream'),
  minifyHTML = require('gulp-minify-html'),
  less = require('gulp-less'),
  minifyCSS = require('gulp-minify-css'),
  concat = require('gulp-concat'),
  uglify = require('gulp-uglify'),
  rename = require("gulp-rename");

//Set to true in `gulp run`
global.isDebug = false;

gulp.task('express', function() {
  require('./app');
});

gulp.task('browserify', function() {
  console.log('global.isDebug', global.isDebug);
  return browserify({
      entries: ['src/index.jsx'],
      debug: global.isDebug,
      insertGlobals: true,
      cache: {},
      packageCache: {},
      fullPaths: true,
      transform: ['reactify']
    })
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulp.dest('./public/'))
    .pipe(livereload());
});

gulp.task('minify-html', function() {
  var opts = {
    conditionals: true,
    spare: true
  };

  return gulp.src('./src/*.html')
    .pipe(minifyHTML({
      conditionals: true,
      spare: true
    }))
    .pipe(gulp.dest('./public/'))
    .pipe(livereload());
});

gulp.task('semantic-conf', function() {
  return gulp.src(['./bower_components/semantic-ui/src/theme.config.example'])
    .pipe(rename('theme.config'))
    .pipe(gulp.dest('./bower_components/semantic-ui/src/'));
});

gulp.task('less', ['semantic-conf'], function() {
  return gulp.src('./src/index.less')
    //plumber
    .pipe(less({
      // paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(minifyCSS())
    .pipe(gulp.dest('./public'))
    .pipe(livereload());
});

gulp.task('images', function() {
  return gulp.src(['./src/*.jpg', './src/*.png'], {
      base: './src'
    })
    .pipe(gulp.dest('./public'));
});

gulp.task('isDebug', function() {
  global.isDebug = true;
});

gulp.task('js-libs', function() {
  return gulp.src([
      'bower_components/jquery/dist/jquery.min.js',
      'bower_components/semantic-ui/dist/semantic.min.js'
    ])
    .pipe(concat('dependencies.js', {
      newLine: ';\n'
    }))
    // .pipe(uglify({
    //   mangle: false,
    //   compress: false
    // }))
    .pipe(gulp.dest('public'));
});


gulp.task('default', ['images', 'browserify', 'less', 'js-libs', 'minify-html']);

gulp.task('run', ['isDebug', 'express', 'default'], function() {
  livereload.listen();
  gulp.watch('src/*.js*', ['browserify']);
  gulp.watch('src/*.less', ['less']);
  gulp.watch('src/*.html', ['minify-html']);
});
{'fraction_non_alphanumeric': 0.23170238576627578, 'fraction_numerical': 0.0, 'mean_word_length': 3.2318220701454234, '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': '2581348', 'n_tokens_mistral': 1777, 'n_tokens_neox': 1752, 'n_words': 261}