generateSourceMap() — vue Function Reference
Architecture documentation for the generateSourceMap() function in parse.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 815e9f10_246a_4f15_57b6_3f6e17f8ab7a["generateSourceMap()"] 9bec4c5e_d04b_64a6_018b_53a3e409ef44["parse()"] 9bec4c5e_d04b_64a6_018b_53a3e409ef44 -->|calls| 815e9f10_246a_4f15_57b6_3f6e17f8ab7a 9bec4c5e_d04b_64a6_018b_53a3e409ef44["parse()"] 815e9f10_246a_4f15_57b6_3f6e17f8ab7a -->|calls| 9bec4c5e_d04b_64a6_018b_53a3e409ef44 style 815e9f10_246a_4f15_57b6_3f6e17f8ab7a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/compiler-sfc/src/parse.ts lines 97–129
function generateSourceMap(
filename: string,
source: string,
generated: string,
sourceRoot: string,
pad?: 'line' | 'space' | boolean
): RawSourceMap {
const map = new SourceMapGenerator({
file: filename.replace(/\\/g, '/'),
sourceRoot: sourceRoot.replace(/\\/g, '/')
})
let offset = 0
if (!pad) {
offset = source.split(generated).shift()!.split(splitRE).length - 1
}
map.setSourceContent(filename, source)
generated.split(splitRE).forEach((line, index) => {
if (!emptyRE.test(line)) {
map.addMapping({
source: filename,
original: {
line: index + 1 + offset,
column: 0
},
generated: {
line: index + 1,
column: 0
}
})
}
})
return JSON.parse(map.toString())
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does generateSourceMap() do?
generateSourceMap() is a function in the vue codebase.
What does generateSourceMap() call?
generateSourceMap() calls 1 function(s): parse.
What calls generateSourceMap()?
generateSourceMap() is called by 1 function(s): parse.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free