<commit_before>module.exports = function (grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    banner: '/*!\n' +
    ' * peeracle v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
    ' * Copyright 2015\n' +
    ' * Licensed under <%= pkg.license %>\n' +
    ' */\n',

    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    },

    concat: {
      options: {
        banner: '<%= banner %>\n\'use strict\';\nvar Peeracle = Peeracle || {};\n',
        process: function(src, filepath) {
          var nostrict = src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
          var nopeeracle = nostrict.replace(/(^|\n)[ \t]*(var Peeracle = Peeracle \|\| {});?\s*/g, '$1');
          var nocheck = nopeeracle.replace(/\s*if \(typeof module === 'undefined'\) {\s*(Peeracle..* = .*;)\s*} else {\s*module.exports = .*;\s*}\s*/g, '\n\n  $1\n');
          return '// Source: ' + filepath + '\n' +
            nocheck;
        },
        stripBanners: false
      },
      dist: {
        src: [
          'src/mediachannel.js',
          'src/signalchannel.js',
          'src/peer.js',
          'src/tracker.js'
        ],
        dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js'
      }
    },

    uglify: {
      options: {
        preserveComments: 'some'
      },
      build: {
        src: 'dist/<%= pkg.name %>-<%= pkg.version %>.js',
        dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.min.js'
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');

  // Default task(s).
  grunt.registerTask('default', ['karma', 'concat', 'uglify']);

  grunt.registerTask('build', ['concat', 'uglify']);
};<commit_msg>Concat first, run karma later<commit_after>module.exports = function (grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    banner: '/*!\n' +
    ' * peeracle v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
    ' * Copyright 2015\n' +
    ' * Licensed under <%= pkg.license %>\n' +
    ' */\n',

    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    },

    concat: {
      options: {
        banner: '<%= banner %>\n\'use strict\';\nvar Peeracle = Peeracle || {};\n',
        process: function(src, filepath) {
          var nostrict = src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
          var nopeeracle = nostrict.replace(/(^|\n)[ \t]*(var Peeracle = Peeracle \|\| {});?\s*/g, '$1');
          var nocheck = nopeeracle.replace(/\s*if \(typeof module === 'undefined'\) {\s*(Peeracle..* = .*;)\s*} else {\s*module.exports = .*;\s*}\s*/g, '\n\n  $1\n');
          return '// Source: ' + filepath + '\n' +
            nocheck;
        },
        stripBanners: false
      },
      dist: {
        src: [
          'src/mediachannel.js',
          'src/signalchannel.js',
          'src/peer.js',
          'src/tracker.js'
        ],
        dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js'
      }
    },

    uglify: {
      options: {
        preserveComments: 'some'
      },
      build: {
        src: 'dist/<%= pkg.name %>-<%= pkg.version %>.js',
        dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.min.js'
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');

  // Default task(s).
  grunt.registerTask('default', ['concat', 'karma', 'uglify']);

  grunt.registerTask('build', ['concat', 'uglify']);
};
{'fraction_non_alphanumeric': 0.22397223705285638, 'fraction_numerical': 0.0037373198077949813, 'mean_word_length': 2.1095435684647303, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '47232', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1333, 'n_words': 246}