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

Commit

Permalink
rollup source maps support
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 14, 2016
1 parent d63741d commit db4b3a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/rollup.js
Expand Up @@ -236,7 +236,10 @@ exports.rollupTree = function(loader, tree, entryPoints, traceOpts, compileOpts)
return resolved;
},
load: function(id, options) {
return tree[id].metadata.originalSource || tree[id].source;
return {
code: tree[id].metadata.originalSource || tree[id].source,
map: tree[id].metadata.sourceMap
};
}
}],
onwarn: function(message) {}
Expand Down Expand Up @@ -275,11 +278,12 @@ exports.rollupTree = function(loader, tree, entryPoints, traceOpts, compileOpts)
var output = bundle.generate(generateOptions);

// convert sources list into paths
// no input source maps support, so nothing more to worry about here
if (output.map)
if (output.map) {
output.map.sources = output.map.sources.map(function(name) {
return tree[name].path;
name = loader.getCanonicalName(loader.decanonicalize(name));
return tree[name] && tree[name].path || loader.decanonicalize(name);
});
}

if (fullTreeRollup)
return {
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.30.0",
"rollup": "^0.31.2",
"source-map": "^0.5.3",
"systemjs": "^0.19.31",
"traceur": "0.0.105",
Expand Down

0 comments on commit db4b3a8

Please sign in to comment.