Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
conditional build corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed May 15, 2016
1 parent 550e22c commit 009ecf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function wrapSFXOutputs(loader, tree, modules, outputs, entryPoints, compileOpts
(exportDefault ? "true" : "false") + ", function(" + compileOpts.systemGlobal + ") {");

outputs.push("})");
return asp(fs.readFile)(path.resolve(__dirname, '../templates/sfx-' + compileOpts.format + '.js'))
return asp(fs.readFile)(path.resolve(__dirname, '../templates/sfx-' + compileOpts.format + '.js'));
})
// then include the sfx module format wrapper
.then(function(formatWrapper) {
Expand Down
6 changes: 4 additions & 2 deletions lib/trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ Trace.prototype.getLoadRecord = function(canonical, excludeURLs, parentStack) {
return loader.normalize(normalizedPkgName)
.then(function() {
pkg = loader.packages[normalizedPkgName];
envMap = pkg.map[subPath];

var mapMatch = getMapMatch(pkg.map, subPath);
envMap = pkg.map[mapMatch];

if (!envMap)
throw new Error('Package conditional ' + canonical + ' has no package conditional map present.');
Expand Down Expand Up @@ -676,7 +678,7 @@ Trace.prototype.inlineConditions = function(tree, loader, conditionalEnv) {
if (branches.length == 0)
throw new TypeError('No resolution found at all for condition ' + c + '.');

conditionalResolutions[c] = branches[0].branch;
conditionalResolutions[c] = branches[0];
});

// resolve any chained conditionals
Expand Down

0 comments on commit 009ecf9

Please sign in to comment.