improve usability of includeSources (#3057)

Exclude source contents from input source map if `includeSources=false`

fixes #3041
This commit is contained in:
Alex Lam S.L
2018-04-06 13:32:26 +08:00
committed by GitHub
parent 44116c6d2b
commit 0b62a28b47
4 changed files with 84 additions and 48 deletions

View File

@@ -121,7 +121,8 @@ describe("bin/uglifyjs", function () {
var command = [
uglifyjscmd,
"--source-map", "content=" + mapFile,
"--source-map", "url=inline"
"--source-map", "includeSources=true",
"--source-map", "url=inline",
].join(" ");
var child = exec(command, function(err, stdout) {
@@ -216,7 +217,14 @@ describe("bin/uglifyjs", function () {
});
});
it("Should process inline source map", function(done) {
var command = uglifyjscmd + " test/input/issue-520/input.js -mc toplevel --source-map content=inline,url=inline";
var command = [
uglifyjscmd,
"test/input/issue-520/input.js",
"-mc", "toplevel",
"--source-map", "content=inline",
"--source-map", "includeSources=true",
"--source-map", "url=inline",
].join(" ");
exec(command, function (err, stdout) {
if (err) throw err;