function resolve( results, entries ) {
	var data;
	var keys;
	var len;
	var key;
	var dir;
	var pkg;
	var v;
	var o;
	var i;
	var j;
	var k;

	len = entries.length;

	debug( 'Resolving %d package aliases...', len );
	for ( i = 0; i < len; i++ ) {
		dir = entries[ i ].dir;
		pkg = entries[ i ].pkg;
		k = i + 1;

		debug( 'Resolving package: %s (%d of %d)...', pkg, k, len );
		data = readJSON( path.join( dir, 'package.json' ), FOPTS );
		if ( data instanceof Error ) {
			debug( 'Encountered an error when resolving package meta data: %s (%d of %d). Error: %s', pkg, k, len, data.message );
			return data;
		}
		debug( 'Successfully resolved package meta data: %s (%d of %d).', pkg, k, len );

		if ( isString( data.browser ) ) {
			v = path.resolve( dir, data.browser );

			// Check for a valid `main` field...
			if ( isString( data.main ) ) {
				key = path.resolve( dir, data.main );
				results[ i ].aliases[ key ] = v;
			} else {
				key = path.join( dir, 'index.js' );
				results[ i ].aliases[ key ] = v;
			}
		} else if ( isPlainObject( data.browser ) ) {
			keys = objectKeys( data.browser );
			o = results[ i ].aliases;
			for ( j = 0; j < keys.length; j++ ) {
				key = keys[ j ];
				v = path.resolve( dir, data.browser[ key ] );
				key = path.resolve( dir, key );
				o[ key ] = v;
			}
		}
		debug( 'Successfully resolved package aliases: %s (%d of %d).', pkg, k, len );
	}
	debug( 'Resolved all package aliases.' );
	return results;
}
Synchronously resolves package dependency aliases.

@private
@param {ObjectArray} results - results (output) object
@param {ObjectArray} entries - entry points
@returns {(ObjectArray|Error)} results or an error