compilers/json.js
function optimizePackageConfig(json) {
  if (json.systemjs)
    json = json.systemjs;

  // remove non SystemJS package config properties
  var loaderConfigProperties = ['baseDir', 'defaultExtension', 'format', 'meta', 'map', 'main'];
  for (var p in json)
    if (loaderConfigProperties.indexOf(p) == -1)
      delete json[p];

  if (json.map && !json.map['@env']) {
    Object.keys(json.map).forEach(function(target) {
      var mapped = json.map[target];

      if (typeof mapped == 'string' && mapped.substr(0, 6) == '@node/')
        delete json.map[target];

      if (typeof mapped == 'object') {
        Object.keys(mapped).forEach(function(condition) {
          if (condition == 'node')
            delete mapped[condition];
        });
        if (!hasProperties(mapped))
          delete json.map[target];
      }
    });

    if (!hasProperties(json.map))
      delete json.map;
  }

  return json;
}
function optimizePackageConfig(json) {
  if (json.systemjs)
    json = json.systemjs;

  // remove non SystemJS package config properties
  var loaderConfigProperties = ['baseDir', 'defaultExtension', 'format', 'meta', 'map', 'main'];
  for (var p in json)
    if (loaderConfigProperties.indexOf(p) == -1)
      delete json[p];

  if (json.map && !json.map['@env']) {
    Object.keys(json.map).forEach(function(target) {
      var mapped = json.map[target];

      if (typeof mapped == 'string' && mapped.substr(0, 6) == '@node/')
        delete json.map[target];

      if (typeof mapped == 'object') {
        Object.keys(mapped).forEach(function(condition) {
          if (condition == 'node')
            delete mapped[condition];
        });
        if (!hasProperties(mapped))
          delete json.map[target];
      }
    });

    if (!hasProperties(json.map))
      delete json.map;
  }

  return json;
}
function optimizePackageConfig ( json ) { if ( json . systemjs ) json = json . systemjs ; // remove non SystemJS package config properties var loaderConfigProperties = [ 'baseDir' , 'defaultExtension' , 'format' , 'meta' , 'map' , 'main' ] ; for ( var p in json ) if ( loaderConfigProperties . indexOf ( p ) == - 1 ) delete json [ p ] ; if ( json . map && ! json . map [ '@env' ] ) { Object . keys ( json . map ) . forEach ( function ( target ) { var mapped = json . map [ target ] ; if ( typeof mapped == 'string' && mapped . substr ( 0 , 6 ) == '@node/' ) delete json . map [ target ] ; if ( typeof mapped == 'object' ) { Object . keys ( mapped ) . forEach ( function ( condition ) { if ( condition == 'node' ) delete mapped [ condition ] ; } ) ; if ( ! hasProperties ( mapped ) ) delete json . map [ target ] ; } } ) ; if ( ! hasProperties ( json . map ) ) delete json . map ; } return json ; }
because bundles are for the browser only if this is a package config file json we are compiling then we can optimize out the node-only configurations to make it smaller
because bundles are for the browser only if this is a package config file json we are compiling then we can optimize out the node - only configurations to make it smaller