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

Commit

Permalink
rollup 0.26 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 5, 2016
1 parent 804e63e commit 10179fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
31 changes: 7 additions & 24 deletions lib/rollup.js
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down

0 comments on commit 10179fd

Please sign in to comment.