diff --git a/loader.js b/loader.js index ba9b80a2..ad5bc37f 100644 --- a/loader.js +++ b/loader.js @@ -350,9 +350,16 @@ // module names starting with '#' are never normalized // useful for plugins where the import doesn't represent a real path if (name.substr(0, 1) != '#') { + + // location relative normalization + if (name.substr(0, 2) == './' && referer && referer.name && referer.name.indexOf(':') != -1) + name = referer.name.substr(0, referer.name.indexOf(':') + 1) + name.substr(2); // do standard normalization (resolve relative module name) - name = global.System.normalize(name, referer); + else + name = global.System.normalize(name, referer); + + console.log(name); // do map config name = applyMap(name, parentName); @@ -361,7 +368,6 @@ if (pluginName) name = name + '!' + pluginName; - return name; }, resolve: function(name, options) { @@ -821,7 +827,7 @@ github: 'https://github.jspm.io', npm: 'https://npm.jspm.io', cdnjs: 'https://cdnjs.cloudflare.com/ajax/libs', - plugin: 'https://github.jspm.io/jspm/plugins@0.0.8' + plugin: 'https://github.jspm.io/jspm/plugins@master' } }); diff --git a/test/test.html b/test/test.html index 8a1372c0..ab9933cc 100644 --- a/test/test.html +++ b/test/test.html @@ -123,6 +123,7 @@ jspm.import(['mypath:path'], complete); }, confirm: function(m) { + console.log(m); if (m != 'path') return 'module not loaded'; } diff --git a/test/tests/dep.js b/test/tests/dep.js new file mode 100644 index 00000000..20e4f186 --- /dev/null +++ b/test/tests/dep.js @@ -0,0 +1 @@ +define({}); diff --git a/test/tests/path.js b/test/tests/path.js index b09cdce8..2abaaec4 100644 --- a/test/tests/path.js +++ b/test/tests/path.js @@ -1 +1,2 @@ -window.p = 'path'; +require('./dep'); +module.exports = 'path';