diff --git a/app/scripts/main.js b/app/scripts/main.js index 525100b7de..16a15570a3 100644 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -5,10 +5,12 @@ 'use strict'; require([ - './require_config', - './lib/app-start' + './require_config' ], function (RequireConfig, AppStart) { - var appStart = new AppStart(); - appStart.startApp(); + // Ensure config is loaded before trying to load any other scripts. + require(['./lib/app-start'], function (AppStart) { + var appStart = new AppStart(); + appStart.startApp(); + }); }); diff --git a/app/tests/main.js b/app/tests/main.js index 22693e46fd..65e068b4ce 100644 --- a/app/tests/main.js +++ b/app/tests/main.js @@ -3,10 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ require([ - '../scripts/require_config', - './test_start' + '../scripts/require_config' ], -function (RequireConfig, TestStart) { +function (RequireConfig) { 'use strict'; - // don't need to do anything. + // Ensure config is loaded before trying to load any other scripts. + require(['../tests/test_start'], function () { + // nothing to do here. + }); });