mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
relative location refinement
This commit is contained in:
parent
e79cecb1ec
commit
f6bf4b1cc3
@ -350,9 +350,10 @@
|
||||
// module names starting with '#' are never normalized
|
||||
// useful for plugins where the import doesn't represent a real path
|
||||
if (name.substr(0, 1) != '#') {
|
||||
|
||||
console.log(name);
|
||||
console.log(referer && referer.name);
|
||||
// location relative normalization
|
||||
if (name.substr(0, 2) == './' && referer && referer.name && referer.name.indexOf(':') != -1)
|
||||
if (name.substr(0, 2) == './' && referer && referer.name && referer.name.indexOf(':') != -1 && referer.name.indexOf('/') == -1)
|
||||
name = referer.name.substr(0, referer.name.indexOf(':') + 1) + name.substr(2);
|
||||
|
||||
// do standard normalization (resolve relative module name)
|
||||
@ -361,7 +362,7 @@
|
||||
|
||||
// do map config
|
||||
name = applyMap(name, parentName);
|
||||
|
||||
console.log(name);
|
||||
}
|
||||
|
||||
if (pluginName)
|
||||
|
||||
@ -120,10 +120,9 @@
|
||||
'mypath': './tests'
|
||||
}
|
||||
});
|
||||
jspm.import(['mypath:path'], complete);
|
||||
jspm.import(['mypath:path', 'mypath:deep/deep'], complete);
|
||||
},
|
||||
confirm: function(m) {
|
||||
console.log(m);
|
||||
if (m != 'path')
|
||||
return 'module not loaded';
|
||||
}
|
||||
|
||||
1
test/tests/deep/deep-dep.js
Normal file
1
test/tests/deep/deep-dep.js
Normal file
@ -0,0 +1 @@
|
||||
define({});
|
||||
1
test/tests/deep/deep.js
Normal file
1
test/tests/deep/deep.js
Normal file
@ -0,0 +1 @@
|
||||
require('./deep-dep');
|
||||
Loading…
x
Reference in New Issue
Block a user