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

Commit

Permalink
fixes jspm/jspm-cli#1660, add static tree info
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Mar 30, 2016
1 parent b7084cc commit e7b4ca5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,16 @@ Builder.prototype.buildStatic = function(expressionOrTree, outFile, opts) {
if (opts && opts.config)
this.config(opts.config);

// NB this "first module" detection should really be done at the arithmetic level
// if only one module is provided, it is an entry point
var entryPoints;
if (typeof expressionOrTree == 'string')
entryPoints = [expressionOrTree.split(/ [\+\&\-] /)[0]];
else if (expressionOrTree instanceof Array)
entryPoints = expressionOrTree[0];
// ensure globs are not themsleves entry points
if (entryPoints[0] && entryPoints[0].indexOf('*') != -1)
entryPoints = [];

var outputOpts = processOutputOpts(opts, { outFile: outFile });
var traceOpts = processTraceOpts(opts, { tracePackageConfig: false });
Expand Down Expand Up @@ -661,6 +665,7 @@ Builder.prototype.buildStatic = function(expressionOrTree, outFile, opts) {
output.modules = Object.keys(tree).filter(function(moduleName) {
return tree[moduleName] && !tree[moduleName].conditional;
});
output.tree = tree;
return output;
});
});
Expand Down

0 comments on commit e7b4ca5

Please sign in to comment.