[Framework] Add RequireJS configurator

Add a configuration step (as part of the resolve phase)
to the framework layer, where bundle-defined paths and shims
are passed to RequireJS configuration. This permits both
the use of non-AMD modules and the exposure of libraries
across bundles. WTD-568.
This commit is contained in:
Victor Woeltjen
2015-01-02 17:46:50 -08:00
parent d281bd52de
commit 96aaea5e58
8 changed files with 191 additions and 9 deletions

View File

@ -101,6 +101,33 @@ define(
return resolvePath(subpath);
},
/**
* Get the path to this bundle's library folder. If an
* argument is provided, the path will be to the library
* file within the bundle's resource file.
*
* @memberof Bundle#
* @param {string} [libraryFile] optionally, give a path to
* a specific library file in the bundle.
* @returns {string}
*/
getLibraryPath: function (libraryFile) {
var subpath = libraryFile ?
[ definition.libraries, libraryFile ] :
[ definition.libraries ];
return resolvePath(subpath);
},
/**
* Get library configuration for this bundle. This is read
* from the bundle's definition; if the bundle is well-formed,
* it will resemble a require.config object.
* @memberof Bundle#
* @returns {object}
*/
getConfiguration: function () {
return definition.configuration || {};
},
/**
* Get a log-friendly name for this bundle; this will
* include both the key (machine-readable name for this