Home / Function/ formatStylusSourceMap() — vite Function Reference

formatStylusSourceMap() — vite Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5966ecdc_9762_a343_8afc_07170ca8f866["formatStylusSourceMap()"]
  c3eb47df_971b_0616_6c9f_29b3ded72224["css.ts"]
  5966ecdc_9762_a343_8afc_07170ca8f866 -->|defined in| c3eb47df_971b_0616_6c9f_29b3ded72224
  158d0e42_28ce_8bd3_13df_1f08b6dbf23f["stylProcessor()"]
  158d0e42_28ce_8bd3_13df_1f08b6dbf23f -->|calls| 5966ecdc_9762_a343_8afc_07170ca8f866
  a4adb1a7_cf54_091f_eb63_8217e684a8e1["normalizePath()"]
  5966ecdc_9762_a343_8afc_07170ca8f866 -->|calls| a4adb1a7_cf54_091f_eb63_8217e684a8e1
  dfa2b928_25a4_a78f_1e11_1e7e643cae09["resolve()"]
  5966ecdc_9762_a343_8afc_07170ca8f866 -->|calls| dfa2b928_25a4_a78f_1e11_1e7e643cae09
  style 5966ecdc_9762_a343_8afc_07170ca8f866 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/css.ts lines 3076–3093

function formatStylusSourceMap(
  mapBefore: ExistingRawSourceMap | undefined,
  root: string,
): ExistingRawSourceMap | undefined {
  if (!mapBefore) return undefined
  const map = { ...mapBefore }

  const resolveFromRoot = (p: string | null) =>
    normalizePath(path.resolve(root, p!))

  if (map.file) {
    map.file = resolveFromRoot(map.file)
  }
  // Note: the real `Sourcemap#sources` maybe `null`, but rollup typing is not handle it.
  map.sources = map.sources!.map(resolveFromRoot)

  return map
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does formatStylusSourceMap() do?
formatStylusSourceMap() is a function in the vite codebase, defined in packages/vite/src/node/plugins/css.ts.
Where is formatStylusSourceMap() defined?
formatStylusSourceMap() is defined in packages/vite/src/node/plugins/css.ts at line 3076.
What does formatStylusSourceMap() call?
formatStylusSourceMap() calls 2 function(s): normalizePath, resolve.
What calls formatStylusSourceMap()?
formatStylusSourceMap() is called by 1 function(s): stylProcessor.

Analyze Your Own Codebase

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

Try Supermodel Free