add sourceMappingUrl to output in node module
authorOiNutter <willmckenzie@oinutter.co.uk>
Fri, 11 Apr 2014 15:09:56 +0000 (16:09 +0100)
committerEric Bednarz <github@bednarz.nl>
Sun, 13 Apr 2014 09:48:38 +0000 (11:48 +0200)
If options.outSourceMap is specified the sourceMappingURL comment
should be appended to the output stream

tools/node.js

index 04e67e7..084998d 100644 (file)
@@ -126,6 +126,11 @@ exports.minify = function(files, options) {
     }
     var stream = UglifyJS.OutputStream(output);
     toplevel.print(stream);
+
+    if(options.outSourceMap){
+        stream += "\n//# sourceMappingURL=" + options.outSourceMap;
+    }
+
     return {
         code : stream + "",
         map  : output.source_map + ""