diff --git a/lib/rollup.js b/lib/rollup.js index 0ca922e..e830d51 100644 --- a/lib/rollup.js +++ b/lib/rollup.js @@ -290,33 +290,16 @@ exports.rollupTree = function(loader, tree, entryPoints, traceOpts, compileOpts) // replace the entry point module itself with the inlined subgraph module var curInlined = inlineMap[entryPoint] || []; - // merge all external deps across all inlined modules - // when a duplicate dependency is hit, throw as we don't - // have the ability to handle renaming without https://github.com/rollup/rollup/issues/424 - var mergedDepMap = extend({}, entryPointLoad.depMap); - var mergedDeps = [].concat(entryPointLoad.deps.filter(function(dep) { - return externals.indexOf(entryPointLoad.depMap[dep]) != -1; - })); - - curInlined.forEach(function(inlinedModule) { - var inlinedLoad = tree[inlinedModule]; - - mergedDeps = mergedDeps.concat(inlinedLoad.deps.filter(function(dep) { - if (externals.indexOf(inlinedLoad.depMap[dep]) != -1) { - if (mergedDeps.indexOf(dep) == -1) - return true; - - if (inlinedLoad.depMap[dep] != mergedDepMap[dep]) - throw new Error('Duplicate dependency "' + dep + '" while using Rollup on "' + inlinedModule + '". Rename the dependency, or post to https://github.com/rollup/rollup/issues/424.'); - } - })); - - extend(mergedDepMap, inlinedLoad.depMap); + // the process of running rollup will itself normalize all dependencies + // the depMap then just becomes the identity map + var inlinedDepMap = {}; + aliasedExternals.forEach(function(dep) { + inlinedDepMap[dep] = dep; }); rolledUpTree[entryPoint] = extend(extend({}, entryPointLoad), { - deps: mergedDeps, - depMap: mergedDepMap, + deps: aliasedExternals, + depMap: inlinedDepMap, metadata: extend(extend({}, entryPointLoad.metadata), { originalSource: undefined, sourceMap: output.map diff --git a/package.json b/package.json index db4d301..ad197d8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "es6-template-strings": "^2.0.0", "glob": "^7.0.3", "mkdirp": "^0.5.1", - "rollup": "^0.25.0", + "rollup": "^0.26.4", "source-map": "^0.5.3", "systemjs": "^0.19.28", "traceur": "0.0.105",