lib/stream/write_bundle_manifest.js
function getSharedBundlesOf(name, baseUrl, bundles, mains) {
	var shared = {};
	var normalize = require("normalize-path");
	// this will ensure that we only add the main bundle if there is a single
	// main; not a multi-main project.
	var singleMain = mains.length === 1 && mains[0];

	bundles.forEach(function(bundle) {
		if (includes(bundle.bundles, name) ||
			includes(bundle.bundles, singleMain)) {
			var relative = normalize(
				path.relative(
					baseUrl.replace("file:", ""),
					bundle.bundlePath
				)
			);

			shared[relative] = {
				weight: getWeightOf(bundle),
				type: isJavaScriptBundle(bundle) ? "script" : "style"
			};
		}
	});

	return shared;
}
function getSharedBundlesOf(name, baseUrl, bundles, mains) {
	var shared = {};
	var normalize = require("normalize-path");
	// this will ensure that we only add the main bundle if there is a single
	// main; not a multi-main project.
	var singleMain = mains.length === 1 && mains[0];

	bundles.forEach(function(bundle) {
		if (includes(bundle.bundles, name) ||
			includes(bundle.bundles, singleMain)) {
			var relative = normalize(
				path.relative(
					baseUrl.replace("file:", ""),
					bundle.bundlePath
				)
			);

			shared[relative] = {
				weight: getWeightOf(bundle),
				type: isJavaScriptBundle(bundle) ? "script" : "style"
			};
		}
	});

	return shared;
}
function getSharedBundlesOf ( name , baseUrl , bundles , mains ) { var shared = { } ; var normalize = require ( "normalize-path" ) ; // this will ensure that we only add the main bundle if there is a single // main; not a multi-main project. var singleMain = mains . length === 1 && mains [ 0 ] ; bundles . forEach ( function ( bundle ) { if ( includes ( bundle . bundles , name ) || includes ( bundle . bundles , singleMain ) ) { var relative = normalize ( path . relative ( baseUrl . replace ( "file:" , "" ) , bundle . bundlePath ) ) ; shared [ relative ] = { weight : getWeightOf ( bundle ) , type : isJavaScriptBundle ( bundle ) ? "script" : "style" } ; } } ) ; return shared ; }
Returns an object of shared bundles data
@param {string} name - A bundle name
@param {string} baseUrl - The loader's baseURL
@param {Array} bundles - The bundles array created by the build process
@param {Array} mains - The main entry point modules
@return {Object} Each key is a shared bundle relative path and the value
contains the `weight` and `type` of the bundle
Returns an object of shared bundles data