aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/node.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/node.js b/tools/node.js
index bf47abad..fccdd83f 100644
--- a/tools/node.js
+++ b/tools/node.js
@@ -92,9 +92,13 @@ exports.minify = function(files, options) {
// 4. output
var map = null;
+ var inMap = null;
+ if (options.inSourceMap) {
+ inMap = fs.readFileSync(options.inSourceMap, "utf8");
+ }
if (options.outSourceMap) map = UglifyJS.SourceMap({
file: options.outSourceMap,
- orig: fs.readFileSync(options.inSourceMap, "utf8")
+ orig: inMap
});
var stream = UglifyJS.OutputStream({ source_map: map });
toplevel.print(stream);