Support input source map

This is useful while compressing generated code; for example compressing JS
compiled by CoffeeScript (assuming you got a source map):

    uglifyjs2 --in-source-map generated.js.map \
              --source-map uglified.js.map \
              -o uglified.js

The above assumes you have a "generated.js.map" file which is the source
mapping between your CoffeeScript and the generated.js (compiled output from
CoffeeScript).  The name of the input file is not present in this example;
it will be fetched from the source map (but it can be passed manually too).

The output will be in "uglified.js" and the output map "uglified.js.map"
will actually map to the original CoffeeScript code, rather than to
generated.js.
This commit is contained in:
Mihai Bazon
2012-09-24 17:02:18 +03:00
parent 4f97da9660
commit 42038fd67f
3 changed files with 36 additions and 18 deletions

View File

@@ -55,7 +55,6 @@ function OutputStream(options) {
ie_proof : true,
beautify : true,
source_map : null,
in_source_map : null
});
var indentation = 0;