<commit_before>// Copyright 2016, University of Colorado Boulder

/**
 * Combine and minify all of the code/images/audio using r.js, almond and uglify2.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */
var requirejs = require( 'requirejs' );

/**
 * @param {Object} grunt - the grunt instance
 * @param {Object} buildConfig - the buildConfig
 */
module.exports = function( grunt, buildConfig ) {
  'use strict';

  // The name of the repository from which grunt was launched.
  var repositoryName = buildConfig.name;

  // Wait until build complete
  var done = grunt.task.current.async();

  // Copied from getGruntConfig
  var config = {

    // Includes a require.js stub called almond, so that we don't have to include the full require.js runtime
    // inside of builds. This helps reduce file size, and the rest of require.js isn't needed. See
    // https://github.com/phetsims/chipper/issues/277
    // See https://github.com/requirejs/almond for more about specifying name=almond
    name: 'almond',

    // Avoid optimization names that are outside the baseUrl, see http://requirejs.org/docs/optimization.html#pitfalls
    paths: {
      almond: '../../sherpa/lib/almond-0.2.9'
    },

    // Start the main launch
    insertRequire: [ repositoryName + '-main' ],

    // JS config file
    mainConfigFile: 'js/' + repositoryName + '-config.js',

    // optimized output file
    out: 'build/' + repositoryName + '.min.js',

    // use the default wrapping strategy to wrap the module code, so that define/require are not globals
    wrap: true,

    // turn off preservation of comments that have a license in them
    preserveLicenseComments: false,

    // Minification strategy.
    optimize: grunt.option( 'uglify' ) === false ? 'none' : 'uglify2',

    // uglify2 configuration options<commit_msg>Launch main synchronously, see https://github.com/phetsims/chipper/issues/499<commit_after>// Copyright 2016, University of Colorado Boulder

/**
 * Combine and minify all of the code/images/audio using r.js, almond and uglify2.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */
var requirejs = require( 'requirejs' );

/**
 * @param {Object} grunt - the grunt instance
 * @param {Object} buildConfig - the buildConfig
 */
module.exports = function( grunt, buildConfig ) {
  'use strict';

  // The name of the repository from which grunt was launched.
  var repositoryName = buildConfig.name;

  // Wait until build complete
  var done = grunt.task.current.async();

  // Copied from getGruntConfig
  var config = {

    // Includes a require.js stub called almond, so that we don't have to include the full require.js runtime
    // inside of builds. This helps reduce file size, and the rest of require.js isn't needed. See
    // https://github.com/phetsims/chipper/issues/277
    // See https://github.com/requirejs/almond for more about specifying name=almond
    name: 'almond',

    // Avoid optimization names that are outside the baseUrl, see http://requirejs.org/docs/optimization.html#pitfalls
    paths: {
      almond: '../../sherpa/lib/almond-0.2.9'
    },

    // JS config file
    mainConfigFile: 'js/' + repositoryName + '-config.js',

    // optimized output file
    out: 'build/' + repositoryName + '.min.js',

    // Wrap everything in an IIFE so that require/define are not globals, and launch main synchronously
    // see https://github.com/phetsims/scenery/issues/567
    wrap: {
      start: '(function() {',
      end: 'require(\'' + (repositoryName + '-main') + '\');\n' +
           '}());'
    },

    // turn off preservation of comments that have a license in them
    preserveLicenseComments: false,

    // Minification strategy.
    optimize: grunt.option( 'uglify' ) === false ? 'none' : 'uglify2',

    // uglify2 configuration options
{'fraction_non_alphanumeric': 0.12052631578947369, 'fraction_numerical': 0.008421052631578947, 'mean_word_length': 2.980104712041885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, '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': '3681083', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1094, 'n_words': 381}