This commit is contained in:
Sergej Tatarincev 2012-10-09 03:02:40 -07:00
commit 01c2e03d24

View File

@ -92,9 +92,13 @@ exports.minify = function(files, options) {
// 4. output // 4. output
var map = null; var map = null;
var inMap = null;
if (options.inSourceMap) {
inMap = fs.readFileSync(options.inSourceMap, "utf8");
}
if (options.outSourceMap) map = UglifyJS.SourceMap({ if (options.outSourceMap) map = UglifyJS.SourceMap({
file: options.outSourceMap, file: options.outSourceMap,
orig: fs.readFileSync(options.inSourceMap, "utf8") orig: inMap
}); });
var stream = UglifyJS.OutputStream({ source_map: map }); var stream = UglifyJS.OutputStream({ source_map: map });
toplevel.print(stream); toplevel.print(stream);