'Purpose of JavaScript Source Map names array?
The JS source map spec contains an identifier array to which each mapping location can refere to.
{
"version" : 3,
"file": "out.js",
"sourceRoot": "",
"sources": ["foo.js", "bar.js"],
"sourcesContent": [null, null],
"names": ["src", "maps", "are", "fun"],
"mappings": "A,AAAB;;ABCDE;"
}
The mappings array contains a VLQ encoded mapping of locations (column/row) from the minified source back to the original source file.
Why do I still need the names array since the mappings array already contain a mapping. Even when an identifier "foo" gets minified to to "f" we still know the position and the length of the identifier through the mappings array. So, the names array seems redundant for me or am I missing something?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
