mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 15:43:48 +00:00
[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:
@ -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
|
||||
|
Reference in New Issue
Block a user