mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
ensure direct package name lookups
This commit is contained in:
parent
bff0c77bae
commit
d5feb4fbf1
@ -193,7 +193,9 @@ SystemJSLoader.prototype.config = function(cfg) {
|
||||
|
||||
if (cfg.packages) {
|
||||
for (var p in cfg.packages) {
|
||||
var prop = this.normalizeSync(p);
|
||||
// request with trailing "/" to get package name exactly
|
||||
var prop = this.normalizeSync(p + '/');
|
||||
prop = prop.substr(0, prop.length - 1);
|
||||
|
||||
// if doing default js extensions, undo to get package name
|
||||
if (this.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js')
|
||||
|
||||
@ -181,6 +181,10 @@
|
||||
if (normalized.length == pkgName.length)
|
||||
return normalized + defaultExtension;
|
||||
|
||||
// allow for direct package name normalization with trailling "/" (no main)
|
||||
if (normalized.length == pkgName.length + 1 && normalized[pkgName.length] == '/')
|
||||
return normalized;
|
||||
|
||||
// sync normalize does not apply package map
|
||||
if (sync || !pkg.map)
|
||||
return pkgName + '/' + basePath + normalized.substr(pkgName.length + 1) + defaultExtension;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user