Source map URL override from programmatic API
This commit is contained in:
parent
572b97b0bb
commit
a9aa85517f
|
|
@ -43,6 +43,7 @@ exports.minify = function(files, options) {
|
||||||
outSourceMap : null,
|
outSourceMap : null,
|
||||||
sourceRoot : null,
|
sourceRoot : null,
|
||||||
inSourceMap : null,
|
inSourceMap : null,
|
||||||
|
sourceMapUrl : null,
|
||||||
fromString : false,
|
fromString : false,
|
||||||
warnings : false,
|
warnings : false,
|
||||||
mangle : {},
|
mangle : {},
|
||||||
|
|
@ -136,8 +137,9 @@ exports.minify = function(files, options) {
|
||||||
var stream = UglifyJS.OutputStream(output);
|
var stream = UglifyJS.OutputStream(output);
|
||||||
toplevel.print(stream);
|
toplevel.print(stream);
|
||||||
|
|
||||||
if (options.outSourceMap && "string" === typeof options.outSourceMap) {
|
var mappingUrlPrefix = "\n//# sourceMappingURL=";
|
||||||
stream += "\n//# sourceMappingURL=" + options.outSourceMap;
|
if (options.outSourceMap && typeof options.outSourceMap === "string") {
|
||||||
|
stream += mappingUrlPrefix + (typeof options.sourceMapUrl === "string" ? options.sourceMapUrl : options.outSourceMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
var source_map = output.source_map;
|
var source_map = output.source_map;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user