Revert "Revert "Merge pull request #17325 from cpennington/switch-asset-index-factory-to-webpack""

This reverts commit 67177ac72d.

The original PR cause a breakage on production due to webpack building two different
copies of the asset_index.js bundle. However, it is unclear whether that was a
transitory issue or not. This commit restores the original PR to validate whether
the problem is reproducible.
This commit is contained in:
Calen Pennington
2018-02-27 13:59:39 -05:00
parent 8acd6d5eec
commit b1c9ad175d
12 changed files with 262 additions and 75 deletions

View File

@@ -17,7 +17,6 @@
* done.
*/
modules: getModulesList([
'js/factories/asset_index',
'js/factories/base',
'js/factories/container',
'js/factories/course_create_rerun',

View File

@@ -1,2 +1,6 @@
define(['js/base', 'cms/js/main', 'js/src/logger', 'datepair', 'accessibility',
'ieshim', 'tooltip_manager', 'lang_edx', 'js/models/course']);
'ieshim', 'tooltip_manager', 'lang_edx', 'js/models/course'],
function() {
'use strict';
}
);

View File

@@ -0,0 +1,7 @@
define(
['js/factories/asset_index', 'common/js/utils/page_factory', 'js/factories/base'],
function(AssetIndexFactory, invokePageFactory) {
'use strict';
invokePageFactory('AssetIndexFactory', AssetIndexFactory);
}
);

View File

@@ -0,0 +1,11 @@
(function(define) {
'use strict';
define(
['js/models/course'],
function(ContextCourse) {
window.course = new ContextCourse(window.pageFactoryArguments.ContextCourse[0]);
}
);
}).call(this, define || RequireJS.define);

View File

@@ -1,5 +1,5 @@
define(
['js/factories/login', 'common/js/utils/page_factory'],
['js/factories/login', 'common/js/utils/page_factory', 'js/factories/base'],
function(LoginFactory, invokePageFactory) {
'use strict';
invokePageFactory('LoginFactory', LoginFactory);

View File

@@ -1,5 +1,7 @@
require(['domReady', 'jquery', 'jquery.smoothScroll'],
define(['domReady', 'jquery', 'jquery.smoothScroll'],
function(domReady, $) {
'use strict';
var toggleSock = function(e) {
e.preventDefault();
@@ -33,4 +35,5 @@ require(['domReady', 'jquery', 'jquery.smoothScroll'],
// toggling footer additional support
$('.cta-show-sock').bind('click', toggleSock);
});
});
}
);