Avoid adding source map url twice

This commit is contained in:
Brandon Frohs 2014-07-13 21:30:20 -04:00
parent 683aa31747
commit eda3a19b38

View File

@ -134,12 +134,14 @@ exports.minify = function(files, options) {
var stream = UglifyJS.OutputStream(output); var stream = UglifyJS.OutputStream(output);
toplevel.print(stream); toplevel.print(stream);
if(options.outSourceMap){ if(options.sourceMapURL){
stream += "\n//# sourceMappingURL=" + options.sourceMapURL;
} else if(options.outSourceMap){
stream += "\n//# sourceMappingURL=" + options.outSourceMap; stream += "\n//# sourceMappingURL=" + options.outSourceMap;
} }
return { return {
code : stream + (output.source_map ? "\n//@ sourceMappingURL=" + (options.sourceMapURL || options.outSourceMap) : ""), code : stream + "",
map : output.source_map + "" map : output.source_map + ""
}; };
}; };