diff --git a/lib/sourcemap.js b/lib/sourcemap.js index e5d7df60..3714027e 100644 --- a/lib/sourcemap.js +++ b/lib/sourcemap.js @@ -58,6 +58,16 @@ function SourceMap(options) { sourceRoot : options.root }); var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); + + if (orig_map && Array.isArray(options.orig.sources)) { + options.orig.sources.forEach(function(source) { + var sourceContent = orig_map.sourceContentFor(source, true); + if (sourceContent) { + generator.setSourceContent(source, sourceContent); + } + }); + } + function add(source, gen_line, gen_col, orig_line, orig_col, name) { if (orig_map) { var info = orig_map.originalPositionFor({