From 1f8582d05e5e821e7dc16f6ef5f21bac41abcac2 Mon Sep 17 00:00:00 2001 From: eleith Date: Thu, 24 Oct 2013 00:20:26 -0700 Subject: [PATCH] declare a source file even when passing in a string --- tools/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/node.js b/tools/node.js index 614e083d..5f9ae178 100644 --- a/tools/node.js +++ b/tools/node.js @@ -55,6 +55,7 @@ exports.minify = function(files, options) { sourceRoot : null, inSourceMap : null, fromString : false, + fromFile : null, warnings : false, mangle : {}, output : null, @@ -72,7 +73,7 @@ exports.minify = function(files, options) { ? file : fs.readFileSync(file, "utf8"); toplevel = UglifyJS.parse(code, { - filename: options.fromString ? "?" : file, + filename: options.fromString ? options.fromFile || "?" : file, toplevel: toplevel }); });