Skip to content

Commit

Permalink
Merge pull request #930 from adaptlearning/enhancement/929
Browse files Browse the repository at this point in the history
enhancement/929: remove core require mappings "coreJS" "coreViews"
  • Loading branch information
moloko committed Feb 16, 2016
2 parents 0ae5449 + 20c43f4 commit 6045dc9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
16 changes: 10 additions & 6 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ require.config({
inview: 'core/js/libraries/inview',
a11y: 'core/js/libraries/jquery.a11y',
scrollTo: 'core/js/libraries/scrollTo',
coreJS: 'core/js',
coreViews: 'core/js/views',
coreModels: 'core/js/models',
coreCollections: 'core/js/collections',
coreHelpers: 'core/js/helpers',
templates: 'templates/templates'
},
shim: {
Expand Down Expand Up @@ -65,5 +60,14 @@ require.config({
],
exclude: [
'jquery'
]
],
map: {
'*': {
coreJS: 'core/js',
coreViews: 'core/js/views',
coreModels: 'core/js/models',
coreCollections: 'core/js/collections',
coreHelpers: 'core/js/helpers'
}
}
});
22 changes: 19 additions & 3 deletions src/core/js/scriptLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,24 @@
}
return false;
})();

//2. Setup require for old style module declarations
function setupRequireJS() {
requirejs.config({
map: {
'*': {
coreJS: 'core/js',
coreViews: 'core/js/views',
coreModels: 'core/js/models',
coreCollections: 'core/js/collections',
coreHelpers: 'core/js/helpers'
}
}
});
loadJQuery();
}

//2. Load jquery
//3. Load jquery
function loadJQuery() {
Modernizr.load([
{
Expand All @@ -20,7 +36,7 @@
]);
}

//3. Load adapt
//4. Load adapt
function loadAdapt() {
switch (IE) {
case 8: case 9:
Expand All @@ -47,7 +63,7 @@
},
{
load: "libraries/require.js",
complete: loadJQuery
complete: setupRequireJS
}
]);

Expand Down

0 comments on commit 6045dc9

Please sign in to comment.