Skip to content

Commit

Permalink
fix(index): properly normalize for systemjs
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 6, 2016
1 parent 0e2e526 commit aa3c481
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,16 @@ if (!PLATFORM.global.System || !PLATFORM.global.System.import) {
};

DefaultLoader.prototype.loadModule = function(id) {
let existing = this.moduleRegistry[id];
if (existing !== undefined) {
return Promise.resolve(existing);
}
return System.normalize(id).then(newId => {
let existing = this.moduleRegistry[newId];
if (existing !== undefined) {
return Promise.resolve(existing);
}

return System.import(id).then(m => {
this.moduleRegistry[id] = m;
return ensureOriginOnExports(m, id);
return System.import(newId).then(m => {
this.moduleRegistry[newId] = m;
return ensureOriginOnExports(m, newId);
});
});
};

Expand Down

0 comments on commit aa3c481

Please sign in to comment.