Skip to content

Commit

Permalink
nodeConfig takes preference over browserConfig for hybrid environments
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed May 10, 2016
1 parent b25096a commit 6181837
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
if (!isEnvConfig) {
// if using nodeConfig / browserConfig / productionConfig, take baseURL from there
// these exceptions will be unnecessary when we can properly implement config queuings
var baseURL = cfg.nodeConfig && envModule.node && cfg.nodeConfig.baseURL ||
var baseURL = cfg.productionConfig && envModule.production && cfg.productionConfig.baseURL ||
cfg.nodeConfig && envModule.node && cfg.nodeConfig.baseURL ||
cfg.browserConfig && envModule.browser && cfg.browserConfig.baseURL ||
cfg.productionConfig && envModule.production && cfg.productionConfig.baseURL ||
cfg.baseURL;

// always configure baseURL first
Expand All @@ -342,8 +342,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
}

extend(loader.paths, cfg.paths);
extend(loader.paths, cfg.nodeConfig && envModule.node && cfg.nodeConfig.paths);
extend(loader.paths, cfg.browserConfig && envModule.browser && cfg.browserConfig.paths);
extend(loader.paths, cfg.nodeConfig && envModule.node && cfg.nodeConfig.paths);
extend(loader.paths, cfg.productionConfig && envModule.production && cfg.browserConfig.paths);
}

Expand Down Expand Up @@ -494,10 +494,10 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
}
}

if (cfg.nodeConfig && envModule.node)
this.config(cfg.nodeConfig, true);
if (cfg.browserConfig && envModule.browser)
this.config(cfg.browserConfig, true);
if (cfg.nodeConfig && envModule.node)
this.config(cfg.nodeConfig, true);
if (cfg.productionConfig && envModule.production)
this.config(cfg.productionConfig, true);
};

0 comments on commit 6181837

Please sign in to comment.