From 1a5fe196b3d38b50cbc29179d10a4d3250024342 Mon Sep 17 00:00:00 2001 From: Brandon Frohs Date: Mon, 22 Apr 2013 12:37:12 -0400 Subject: [PATCH] Add `sourceMapURL` option. Same as `--source-map-url` in CLI. --- tools/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/node.js b/tools/node.js index c0dd3dbc..1df61bcd 100644 --- a/tools/node.js +++ b/tools/node.js @@ -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 + "" }; };