support specifying the filename when minifying using fromString

This commit is contained in:
brenmar 2013-08-10 03:08:25 +10:00
parent 6ea3f7fe34
commit d6d874ed4d

View File

@ -72,7 +72,7 @@ exports.minify = function(files, options) {
? file ? file
: fs.readFileSync(file, "utf8"); : fs.readFileSync(file, "utf8");
toplevel = UglifyJS.parse(code, { toplevel = UglifyJS.parse(code, {
filename: options.fromString ? "?" : file, filename: options.fromString ? options.fromStringFile || "?" : file,
toplevel: toplevel toplevel: toplevel
}); });
}); });