diff --git a/lib/builder.js b/lib/builder.js index 3cfd1e2..04e0dd8 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -574,9 +574,7 @@ Builder.prototype.bundle = function(expressionOrTree, outFile, opts) { .then(function(compiled) { return writeOutputs(compiled.outputs, self.loader.baseURL, outputOpts) .then(function(output) { - output.modules = Object.keys(tree).filter(function(moduleName) { - return tree[moduleName] && !tree[moduleName].conditional; - }); + output.modules = compiled.modules; output.entryPoints = compiled.entryPoints; output.tree = tree; output.assetList = compiled.assetList; @@ -662,9 +660,7 @@ Builder.prototype.buildStatic = function(expressionOrTree, outFile, opts) { if (inlineMap) output.inlineMap = inlineMap; output.assetList = compiled.assetList; - output.modules = Object.keys(tree).filter(function(moduleName) { - return tree[moduleName] && !tree[moduleName].conditional; - }); + output.modules = compiled.modules; output.tree = tree; return output; }); diff --git a/lib/compile.js b/lib/compile.js index 48e0a4d..c094ef7 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -334,7 +334,8 @@ function compileTree(loader, tree, traceOpts, compileOpts, outputOpts, cache) { return { outputs: outputs, entryPoints: entryPoints, - assetList: assetList + assetList: assetList, + modules: modules.reverse() }; }); }