Merge pull request #470 from ebednarz/master
Fix sourceMapIncludeSources exception in Node API
This commit is contained in:
commit
1a34a13e33
|
|
@ -115,7 +115,7 @@ exports.minify = function(files, options) {
|
||||||
if (options.sourceMapIncludeSources) {
|
if (options.sourceMapIncludeSources) {
|
||||||
for (var file in sourcesContent) {
|
for (var file in sourcesContent) {
|
||||||
if (sourcesContent.hasOwnProperty(file)) {
|
if (sourcesContent.hasOwnProperty(file)) {
|
||||||
options.source_map.get().setSourceContent(file, sourcesContent[file]);
|
output.source_map.get().setSourceContent(file, sourcesContent[file]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,6 +126,11 @@ exports.minify = function(files, options) {
|
||||||
}
|
}
|
||||||
var stream = UglifyJS.OutputStream(output);
|
var stream = UglifyJS.OutputStream(output);
|
||||||
toplevel.print(stream);
|
toplevel.print(stream);
|
||||||
|
|
||||||
|
if(options.outSourceMap){
|
||||||
|
stream += "\n//# sourceMappingURL=" + options.outSourceMap;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
code : stream + "",
|
code : stream + "",
|
||||||
map : output.source_map + ""
|
map : output.source_map + ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user