From eda3a19b38c9dda896f273c9988766d76b193ee2 Mon Sep 17 00:00:00 2001 From: Brandon Frohs Date: Sun, 13 Jul 2014 21:30:20 -0400 Subject: [PATCH] Avoid adding source map url twice --- tools/node.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/node.js b/tools/node.js index 52405f3a..21a202fb 100644 --- a/tools/node.js +++ b/tools/node.js @@ -134,12 +134,14 @@ exports.minify = function(files, options) { var stream = UglifyJS.OutputStream(output); toplevel.print(stream); - if(options.outSourceMap){ + if(options.sourceMapURL){ + stream += "\n//# sourceMappingURL=" + options.sourceMapURL; + } else if(options.outSourceMap){ stream += "\n//# sourceMappingURL=" + options.outSourceMap; } return { - code : stream + (output.source_map ? "\n//@ sourceMappingURL=" + (options.sourceMapURL || options.outSourceMap) : ""), + code : stream + "", map : output.source_map + "" }; };