Home / Function/ combineSourcemapsIfExists() — vite Function Reference

combineSourcemapsIfExists() — vite Function Reference

Architecture documentation for the combineSourcemapsIfExists() function in css.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  ade0e43e_6c50_1bd7_8322_ba7f0b5f15a8["combineSourcemapsIfExists()"]
  c3eb47df_971b_0616_6c9f_29b3ded72224["css.ts"]
  ade0e43e_6c50_1bd7_8322_ba7f0b5f15a8 -->|defined in| c3eb47df_971b_0616_6c9f_29b3ded72224
  e0336cc5_add2_5b51_6027_5f5c568b2852["compileCSSPreprocessors()"]
  e0336cc5_add2_5b51_6027_5f5c568b2852 -->|calls| ade0e43e_6c50_1bd7_8322_ba7f0b5f15a8
  c641d137_b4cd_833f_0387_7d29ec90fde1["compileCSS()"]
  c641d137_b4cd_833f_0387_7d29ec90fde1 -->|calls| ade0e43e_6c50_1bd7_8322_ba7f0b5f15a8
  cb1210e8_03e9_2eec_ef04_aa15d44d4c08["combineSourcemaps()"]
  ade0e43e_6c50_1bd7_8322_ba7f0b5f15a8 -->|calls| cb1210e8_03e9_2eec_ef04_aa15d44d4c08
  style ade0e43e_6c50_1bd7_8322_ba7f0b5f15a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/css.ts lines 1878–1895

function combineSourcemapsIfExists(
  filename: string,
  map1: ExistingRawSourceMap | { mappings: '' } | undefined,
  map2: ExistingRawSourceMap | { mappings: '' } | undefined,
): ExistingRawSourceMap | { mappings: '' } | undefined {
  if (!map1 || !map2) {
    return map1
  }
  if (map1.mappings === '' || map2.mappings === '') {
    return { mappings: '' }
  }
  return combineSourcemaps(filename, [
    // type of version property of ExistingRawSourceMap is number
    // but it is always 3
    map1 as RawSourceMap,
    map2 as RawSourceMap,
  ]) as ExistingRawSourceMap
}

Domain

Subdomains

Frequently Asked Questions

What does combineSourcemapsIfExists() do?
combineSourcemapsIfExists() is a function in the vite codebase, defined in packages/vite/src/node/plugins/css.ts.
Where is combineSourcemapsIfExists() defined?
combineSourcemapsIfExists() is defined in packages/vite/src/node/plugins/css.ts at line 1878.
What does combineSourcemapsIfExists() call?
combineSourcemapsIfExists() calls 1 function(s): combineSourcemaps.
What calls combineSourcemapsIfExists()?
combineSourcemapsIfExists() is called by 2 function(s): compileCSS, compileCSSPreprocessors.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free