mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
package global map fix
This commit is contained in:
parent
b5d6568b57
commit
ea16d855cf
@ -204,17 +204,16 @@
|
||||
if (mapped) {
|
||||
// '.' as a target is the package itself (with package main check)
|
||||
if (mapped == '.')
|
||||
normalized = loader.normalizeSync(pkgName);
|
||||
return loader.normalizeSync(pkgName);
|
||||
// internal package map
|
||||
else if (mapped.substr(0, 2) == './')
|
||||
normalized = pkgName + '/' + basePath + mapped.substr(2);
|
||||
return pkgName + '/' + basePath + mapped.substr(2);
|
||||
// global package map
|
||||
else
|
||||
normalized = normalize.call(loader, mapped);
|
||||
return loader.normalize.call(loader, mapped);
|
||||
}
|
||||
else
|
||||
normalized = pkgName + '/' + basePath + normalized.substr(pkgName.length + 1) + defaultExtension;
|
||||
return normalized;
|
||||
return pkgName + '/' + basePath + normalized.substr(pkgName.length + 1) + defaultExtension;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -884,6 +884,9 @@ asyncTest('Wildcard meta', function() {
|
||||
|
||||
asyncTest('Package configuration CommonJS config example', function() {
|
||||
System.config({
|
||||
map: {
|
||||
'global-test': 'tests/testpkg/test.ts'
|
||||
},
|
||||
packagePaths: ['tests/testpk*'],
|
||||
packages: {
|
||||
'tests/testpkg': {
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"./json": "./json.json",
|
||||
"./dir/": "./dir/index.js",
|
||||
"./dir2": "./dir2/index.json",
|
||||
"./dir/test": "./test.ts",
|
||||
"./dir/test": "global-test",
|
||||
"./env-module": {
|
||||
"browser": "./env-module-browser.js"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user