Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions require.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,17 @@ var requirejs, require, define;
trimDots(name);

//Some use of packages may use a . path to reference the
//'main' module name, so normalize for that.
//'main' module name, so normalize for that. Use the
//package location for relative paths if one is specified.
pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
name = name.join('/');
if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
name = pkgName;
if (pkgConfig) {
if (name.join('/') === pkgName + '/' + pkgConfig.main) {
name = pkgName;
} else if (pkgConfig.location) {
name[0] = pkgConfig.location;
}
}
name = name.join('/');
} else if (name.indexOf('./') === 0) {
// No baseName, so this is ID is resolved relative
// to baseUrl, pull off the leading dot.
Expand Down