add possibility to store source map file in html5 minification

This commit is contained in:
matze
2017-09-04 07:57:17 +02:00
committed by Joshua Granick
parent a9ec17fd2b
commit c4285c2fec
2 changed files with 21 additions and 0 deletions

View File

@@ -191,6 +191,20 @@ class HTML5Helper {
}
if (project.targetFlags.exists ("source-map")) {
args.push ("--create_source_map");
args.push (tempFile + ".map");
if (FileSystem.exists(sourceFile + ".map")) {
args.push ("--source_map_input");
args.push (sourceFile + "|" + sourceFile + ".map");
}
}
if (!LogHelper.verbose) {
args.push ("--jscomp_off=uselessCode");
@@ -199,6 +213,13 @@ class HTML5Helper {
ProcessHelper.runCommand ("", "java", args);
if (project.targetFlags.exists ("source-map")) {
File.copy (tempFile + ".map", sourceFile + ".map");
FileSystem.deleteFile (tempFile + ".map");
}
}
FileSystem.deleteFile (sourceFile);

Binary file not shown.