I use "originalPositionFor" to get the original position.
console.log(JSON.stringify(sourceMap.sources, null, 4));
var smc = new SourceMap.SourceMapConsumer(sourceMap);
var result = smc.originalPositionFor(
{
line: parseInt(lineNumber),
column: parseInt(columnNumber)
});
console.log(result.source);
I print out the "sources" property of sourceMap and the "source" of "originalPosition" results, but they are different, making it hard for me to locate the exact "sourcesContent" of sourceMap.
sourceMap.sources:
[
"webpack:///static/js/manifest.b7cf97680f7a50fa150f.js",
"webpack:///webpack/bootstrap 67e184f9679733298d44"
]
result.source:
webpack:/webpack/bootstrap 67e184f9679733298d44
result.source misses "//", which is quite strange.
Any suggestion? Thx!