Add sourceMapURL option.

Same as `--source-map-url` in CLI.
This commit is contained in:
Brandon Frohs 2013-04-22 12:37:12 -04:00
parent 68394eed93
commit 1a5fe196b3

View File

@ -52,6 +52,7 @@ for (var i in UglifyJS) {
exports.minify = function(files, options) {
options = UglifyJS.defaults(options, {
outSourceMap : null,
sourceMapURL : null,
sourceRoot : null,
inSourceMap : null,
fromString : false,
@ -110,7 +111,7 @@ exports.minify = function(files, options) {
var stream = UglifyJS.OutputStream(output);
toplevel.print(stream);
return {
code : stream + "",
code : stream + (output.source_map ? "\n//@ sourceMappingURL=" + (options.sourceMapURL || options.outSourceMap) : ""),
map : output.source_map + ""
};
};