Skip to main content

generate_js_source_map

Function generate_js_source_map 

Source
pub fn generate_js_source_map<'a>(
    files_map: &impl Files,
    mappings: Vec<(BytePos, LineCol)>,
    original_source_maps: impl IntoIterator<Item = &'a Rope>,
    original_source_maps_complete: bool,
    inline_sources_content: bool,
    names: FxHashMap<BytePos, Atom>,
) -> Result<StructuredSourceMap>
Expand description

Generates a [StructuredSourceMap] for the transformed code, whose sourcesContent entries are individual shared ropes instead of being embedded in the serialized JSON. This keeps later sources URL rewrites and map embedding from copying the source text of every module. Serialize with [StructuredSourceMap::to_rope] where raw bytes are needed.

original_source_maps_complete indicates whether the original_source_maps cover the whole map, i.e. whether every module that ended up in mappings had an original sourcemap.