feat: add option.outFileName for JS API, if absense, sourceMap.file field will deduced

This commit is contained in:
1111hui
2016-10-29 15:21:28 +08:00
committed by Richard van Velzen
parent 2a9989dd18
commit 0a35acbbe7
3 changed files with 16 additions and 5 deletions

View File

@@ -63,13 +63,14 @@ describe("minify", function() {
describe("inSourceMap", function() {
it("Should read the given string filename correctly when sourceMapIncludeSources is enabled (#1236)", function() {
var result = Uglify.minify('./test/input/issue-1236/simple.js', {
outSourceMap: "simple.js.min.map",
outSourceMap: "simple.min.js.map",
inSourceMap: "./test/input/issue-1236/simple.js.map",
sourceMapIncludeSources: true
});
var map = JSON.parse(result.map);
assert.equal(map.file, 'simple.min.js');
assert.equal(map.sourcesContent.length, 1);
assert.equal(map.sourcesContent[0],
'let foo = x => "foo " + x;\nconsole.log(foo("bar"));');