diff --git a/lib/builder.js b/lib/builder.js index 809f093..8961fde 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -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 }); @@ -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; }); });