aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2014-04-13 12:54:12 +0300
committerMihai Bazon <mihai.bazon@gmail.com>2014-04-13 12:54:12 +0300
commit1a34a13e3393a9afd6a032b5c2bf3e29cbdfe153 (patch)
tree532d779892f13acf24790f83bf82041f08967e2f
parent14f290f8abf796bb0a772532e1f6c584744e0e16 (diff)
parentef772b0049828fef64e81ba49f564d45d880b27a (diff)
downloadtracifyjs-1a34a13e3393a9afd6a032b5c2bf3e29cbdfe153.tar.gz
tracifyjs-1a34a13e3393a9afd6a032b5c2bf3e29cbdfe153.zip
Merge pull request #470 from ebednarz/master
Fix sourceMapIncludeSources exception in Node API
-rw-r--r--tools/node.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/node.js b/tools/node.js
index bef296ea..084998da 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -115,7 +115,7 @@ exports.minify = function(files, options) {
if (options.sourceMapIncludeSources) {
for (var file in sourcesContent) {
if (sourcesContent.hasOwnProperty(file)) {
- options.source_map.get().setSourceContent(file, sourcesContent[file]);
+ output.source_map.get().setSourceContent(file, sourcesContent[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 + ""