JS: generate paths in source maps relative to .map file location

See KT-19818
This commit is contained in:
Alexey Andreev
2017-08-29 14:28:15 +03:00
parent 93a3026c6d
commit 9008791a54
31 changed files with 236 additions and 63 deletions
@@ -119,7 +119,8 @@ class DeadCodeElimination(private val logConsumer: (DCELogLevel, String) -> Unit
val sourceMapFile = File(file.outputPath + ".map")
val textOutput = TextOutputImpl()
val sourceMapBuilder = SourceMap3Builder(File(file.outputPath), textOutput, "")
val consumer = SourceMapBuilderConsumer(sourceMapBuilder, SourceFilePathResolver(mutableListOf()), true, true)
val sourcePathResolver = SourceFilePathResolver(mutableListOf(), File(file.outputPath).parentFile)
val consumer = SourceMapBuilderConsumer(sourceMapBuilder, sourcePathResolver, true, true)
block.accept(JsToStringGenerationVisitor(textOutput, consumer))
val sourceMapContent = sourceMapBuilder.build()
sourceMapBuilder.addLink()