From 69c5b110bfab38d42add9bbfd560dad6a1789546 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 13 Jan 2016 12:40:03 -0800 Subject: [PATCH] [API Refactor] Move out non-global require config --- main.js | 10 +--------- .../features/clock/src/controllers/TimerFormatter.js | 12 ++++++++++-- platform/framework/src/Main.js | 10 +++++++++- test-main.js | 9 +-------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/main.js b/main.js index b7fc22bff3..fd5f4533fb 100644 --- a/main.js +++ b/main.js @@ -25,19 +25,11 @@ requirejs.config({ "paths": { "legacyRegistry": "src/legacyRegistry", "angular": "platform/framework/lib/angular.min", - "angular-route": "platform/framework/lib/angular-route.min", - "moment": 'platform/telemetry/lib/moment.min', - "moment-duration-format": 'platform/features/clock/lib/moment-duration-format' + "moment": 'platform/telemetry/lib/moment.min' }, "shim": { "angular": { "exports": "angular" - }, - "angular-route": { - "deps": [ "angular" ] - }, - "moment-duration-format": { - "deps": [ 'moment' ] } } }); diff --git a/platform/features/clock/src/controllers/TimerFormatter.js b/platform/features/clock/src/controllers/TimerFormatter.js index e9ebb79a6b..3a694090b3 100644 --- a/platform/features/clock/src/controllers/TimerFormatter.js +++ b/platform/features/clock/src/controllers/TimerFormatter.js @@ -19,10 +19,18 @@ * this source code distribution or the Licensing information page available * 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( - ['moment', 'moment-duration-format'], + ['moment', '../../lib/moment-duration-format'], function (moment) { "use strict"; diff --git a/platform/framework/src/Main.js b/platform/framework/src/Main.js index cc11b699e4..40636b2d38 100644 --- a/platform/framework/src/Main.js +++ b/platform/framework/src/Main.js @@ -21,6 +21,14 @@ *****************************************************************************/ /*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 * and the wiring-together of the extensions they expose. @@ -32,7 +40,7 @@ define( '../lib/es6-promise-2.0.0.min', './FrameworkLayer', 'angular', - 'angular-route' + '../lib/angular-route.min' ], function ( require, diff --git a/test-main.js b/test-main.js index d3bbb1fcc3..09edf98545 100644 --- a/test-main.js +++ b/test-main.js @@ -44,14 +44,7 @@ require.config({ paths: { 'es6-promise': 'platform/framework/lib/es6-promise-2.0.0.min', - 'moment': 'platform/telemetry/lib/moment.min', - 'moment-duration-format': 'platform/features/clock/lib/moment-duration-format' - }, - - shim: { - 'moment-duration-format': { - deps: [ 'moment' ] - } + 'moment': 'platform/telemetry/lib/moment.min' }, // dynamically load all test files