This commit is contained in:
eleith 2013-10-24 00:42:19 -07:00
parent da1caf6bb7
commit fa82161a4c

View File

@ -63,10 +63,7 @@ exports.minify = function(files, options) {
}); });
if (typeof files == "string") { if (typeof files == "string") {
files = [ files ]; files = [ files ];
options.fromFile = options.fromFile ? [options.fromFile] : ["?"]
if (options.fromFile !== null) {
option.fromFile = [options.fromFile];
}
} }
UglifyJS.base54.reset(); UglifyJS.base54.reset();
@ -78,7 +75,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 ? options.fromFile[index] || "?" : file, filename: options.fromString ? options.fromFile[index] : file,
toplevel: toplevel toplevel: toplevel
}); });
}); });