Add sourceMapURL option.
Same as `--source-map-url` in CLI.
This commit is contained in:
parent
68394eed93
commit
1a5fe196b3
|
|
@ -52,6 +52,7 @@ for (var i in UglifyJS) {
|
||||||
exports.minify = function(files, options) {
|
exports.minify = function(files, options) {
|
||||||
options = UglifyJS.defaults(options, {
|
options = UglifyJS.defaults(options, {
|
||||||
outSourceMap : null,
|
outSourceMap : null,
|
||||||
|
sourceMapURL : null,
|
||||||
sourceRoot : null,
|
sourceRoot : null,
|
||||||
inSourceMap : null,
|
inSourceMap : null,
|
||||||
fromString : false,
|
fromString : false,
|
||||||
|
|
@ -110,7 +111,7 @@ exports.minify = function(files, options) {
|
||||||
var stream = UglifyJS.OutputStream(output);
|
var stream = UglifyJS.OutputStream(output);
|
||||||
toplevel.print(stream);
|
toplevel.print(stream);
|
||||||
return {
|
return {
|
||||||
code : stream + "",
|
code : stream + (output.source_map ? "\n//@ sourceMappingURL=" + (options.sourceMapURL || options.outSourceMap) : ""),
|
||||||
map : output.source_map + ""
|
map : output.source_map + ""
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user