Merge pull request #736 from AlbertoGP/master

fromString option, use index from argument array for filename instead of "?"
This commit is contained in:
Richard van Velzen
2015-08-07 14:12:41 +02:00

View File

@@ -73,13 +73,13 @@ exports.minify = function(files, options) {
} else {
if (typeof files == "string")
files = [ files ];
files.forEach(function(file){
files.forEach(function(file, i){
var code = options.fromString
? file
: fs.readFileSync(file, "utf8");
sourcesContent[file] = code;
toplevel = UglifyJS.parse(code, {
filename: options.fromString ? "?" : file,
filename: options.fromString ? i : file,
toplevel: toplevel
});
});