Skip to content

Commit

Permalink
fixes #18868 - Hardcoded './util/…' paths in dojo-util break when
Browse files Browse the repository at this point in the history
installed via npm

    add ability to pass 'mapPackage' parameter on the command line to add or override a package definition when invoking dojo (e.g. running the build system
  • Loading branch information
vansimke committed Nov 7, 2016
1 parent 133c61a commit 810db61
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _base/configNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ exports.config = function(config){
var arg = (process.argv[i] + "").split("=");
if(arg[0] == "load"){
deps.push(arg[1]);
}else if(arg[0] == "mapPackage") {
var parts = arg[1].split(":"),
name = parts[0],
location=parts[1],
isPrexisting = false;

for (var j = 0; j < config.packages.length; j++) {
var pkg = config.packages[j];
if (pkg.name === name) {
pkg.location = location;
isPrexisting = true;
break;
}
}

if (!isPrexisting) {
config.packages.push({
name: name,
location: location
});
}
}else{
args.push(arg);
}
Expand Down
21 changes: 21 additions & 0 deletions _base/configRhino.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ function rhinoDojoConfig(config, baseUrl, rhinoArgs){
var arg = (rhinoArgs[i] + "").split("=");
if(arg[0] == "load"){
deps.push(arg[1]);
}else if(arg[0] == "mapPackage") {
var parts = arg[1].split(":"),
name = parts[0],
location=parts[1],
isPrexisting = false;

for (var j = 0; j < config.packages.length; j++) {
var pkg = config.packages[j];
if (pkg.name === name) {
pkg.location = location;
isPrexisting = true;
break;
}
}

if (!isPrexisting) {
config.packages.push({
name: name,
location: location
});
}
}
}

Expand Down

0 comments on commit 810db61

Please sign in to comment.