Implement RequireJS Optimizer in the LMS

TNL-2487
This commit is contained in:
Andy Armstrong
2015-06-23 18:49:38 -04:00
committed by cahrens
parent 80cf4d6ecb
commit 7b5f9b8009
32 changed files with 465 additions and 242 deletions

View File

@@ -1,19 +1,21 @@
(function () {
'use strict';
var commonLibrariesPath = 'common/js/common_libraries';
var getModule = function (moduleName, excludeCommonDeps) {
var module = {
name: moduleName
};
if (excludeCommonDeps) {
module.exclude = ['js/factories/common_deps'];
module.exclude = [commonLibrariesPath];
}
return module;
};
var getModulesList = function (modules) {
var result = [getModule('js/factories/common_deps')];
var result = [getModule(commonLibrariesPath)];
return result.concat(modules.map(function (moduleName) {
return getModule(moduleName, true);
}));
@@ -84,6 +86,17 @@
'tender': 'empty:',
'youtube': 'empty:'
},
/**
* Inline requireJS text templates.
*/
inlineText: true,
/**
* Stub out requireJS text in the optimized file, but leave available for non-optimized development use.
*/
stubModules: ["text"],
/**
* If shim config is used in the app during runtime, duplicate the config
* here. Necessary if shim config is used, so that the shim's dependencies

View File

@@ -1 +0,0 @@
define(['domReady!', 'jquery', 'backbone', 'underscore', 'gettext', 'text']);