Skip to content

Commit

Permalink
fix(tracing): ensure that moduleids after 2nd trace do not contain pr…
Browse files Browse the repository at this point in the history
…efixes
  • Loading branch information
JeroenVinke committed Apr 6, 2017
1 parent bff36da commit 05fcdf7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/build/amodro-trace/lib/loader/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ function __exec(contents, r, d, c) {
eval(contents);
}

function normalizeModuleId(moduleId) {
if (parse.hasPrefix(moduleId)) {
moduleId = moduleId.split('!')[1];
}

return moduleId;
}

// Patch requirejs to work for build purposes.
(function() {
var hasProp = lang.hasProp,
Expand Down Expand Up @@ -164,6 +172,8 @@ function __exec(contents, r, d, c) {

var oldNameToUrl = context.nameToUrl;
context.nameToUrl = function (moduleName, ext, skipExt) {
moduleName = normalizeModuleId(moduleName);

var url = oldNameToUrl.call(context, moduleName, ext, skipExt);
return context.normalizePath(url);
};
Expand Down

0 comments on commit 05fcdf7

Please sign in to comment.