[API Refactor] Move out non-global require config

This commit is contained in:
Victor Woeltjen 2016-01-13 12:40:03 -08:00
parent 45142e03dc
commit 69c5b110bf
4 changed files with 21 additions and 20 deletions

10
main.js
View File

@ -25,19 +25,11 @@ requirejs.config({
"paths": { "paths": {
"legacyRegistry": "src/legacyRegistry", "legacyRegistry": "src/legacyRegistry",
"angular": "platform/framework/lib/angular.min", "angular": "platform/framework/lib/angular.min",
"angular-route": "platform/framework/lib/angular-route.min", "moment": 'platform/telemetry/lib/moment.min'
"moment": 'platform/telemetry/lib/moment.min',
"moment-duration-format": 'platform/features/clock/lib/moment-duration-format'
}, },
"shim": { "shim": {
"angular": { "angular": {
"exports": "angular" "exports": "angular"
},
"angular-route": {
"deps": [ "angular" ]
},
"moment-duration-format": {
"deps": [ 'moment' ]
} }
} }
}); });

View File

@ -19,10 +19,18 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/ /*global define,requirejs*/
requirejs.config({
shim: {
'platform/features/clock/lib/moment-duration-format': {
deps: [ 'moment' ]
}
}
});
define( define(
['moment', 'moment-duration-format'], ['moment', '../../lib/moment-duration-format'],
function (moment) { function (moment) {
"use strict"; "use strict";

View File

@ -21,6 +21,14 @@
*****************************************************************************/ *****************************************************************************/
/*global define, window, requirejs*/ /*global define, window, requirejs*/
requirejs.config({
shim: {
'platform/framework/lib/angular-route.min': {
deps: [ 'angular' ]
}
}
});
/** /**
* Implements the framework layer, which handles the loading of bundles * Implements the framework layer, which handles the loading of bundles
* and the wiring-together of the extensions they expose. * and the wiring-together of the extensions they expose.
@ -32,7 +40,7 @@ define(
'../lib/es6-promise-2.0.0.min', '../lib/es6-promise-2.0.0.min',
'./FrameworkLayer', './FrameworkLayer',
'angular', 'angular',
'angular-route' '../lib/angular-route.min'
], ],
function ( function (
require, require,

View File

@ -44,14 +44,7 @@ require.config({
paths: { paths: {
'es6-promise': 'platform/framework/lib/es6-promise-2.0.0.min', 'es6-promise': 'platform/framework/lib/es6-promise-2.0.0.min',
'moment': 'platform/telemetry/lib/moment.min', 'moment': 'platform/telemetry/lib/moment.min'
'moment-duration-format': 'platform/features/clock/lib/moment-duration-format'
},
shim: {
'moment-duration-format': {
deps: [ 'moment' ]
}
}, },
// dynamically load all test files // dynamically load all test files