Permalink
Browse files

fix: do not reject unsupported AMD loader

Previous #50 closed gate to all unsupported AMD loader, this fix rolls back the behavior on unsupported AMD loader, so advanced user can monkey patch aurelia loader at runtime to support any new AMD loader.
  • Loading branch information...
huochunpeng committed Dec 6, 2018
1 parent 1de7a58 commit 846befe735569ae147c681cb528456392bf491ee
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/index.js
@@ -120,16 +120,15 @@ PLATFORM.Loader = DefaultLoader;
if (!PLATFORM.global.System || !PLATFORM.global.System.import) {
if (PLATFORM.global.requirejs) {
let defined;
// Support for requirejs/requirejs
if (typeof PLATFORM.global.requirejs.s === 'object') {
// Support for requirejs/requirejs
defined = PLATFORM.global.requirejs.s.contexts._.defined;
}
// Support for requirejs/alameda
else if (typeof PLATFORM.global.requirejs.contexts === 'object') {
} else if (typeof PLATFORM.global.requirejs.contexts === 'object') {
// Support for requirejs/alameda
defined = PLATFORM.global.requirejs.contexts._.defined;
}
else {
throw new Error('Unknown AMD loader');
} else {
// skip any unknown AMD loader
defined = {};
}
PLATFORM.eachModule = function(callback) {
for (let key in defined) {

0 comments on commit 846befe

Please sign in to comment.