Skip to main content

rewrite_sources

Function rewrite_sources 

Source
pub fn rewrite_sources(
    sm: &SourceMap,
    options: &RewriteOptions<'_>,
) -> SourceMap
Expand description

Create a new SourceMap with rewritten source paths.

  • If strip_prefixes contains "~", auto-detects the common prefix via find_common_prefix.
  • Strips matching prefixes from all source paths.
  • If !with_names, sets all name indices in mappings to u32::MAX.
  • If !with_source_contents, sets all sourcesContent entries to None.

Preserves all mappings, ignore_list, extensions, debug_id, and scopes.