Home / Function/ serializeSourceMap() — tailwindcss Function Reference

serializeSourceMap() — tailwindcss Function Reference

Architecture documentation for the serializeSourceMap() function in source-maps.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  323aa9eb_b53c_c01f_935e_081c8e055a5f["serializeSourceMap()"]
  e4e9a023_fc41_d8d4_832c_c267a305bdbd["toSourceMap()"]
  e4e9a023_fc41_d8d4_832c_c267a305bdbd -->|calls| 323aa9eb_b53c_c01f_935e_081c8e055a5f
  4cd99e59_ac1e_2a1f_0946_33cc1afd2532["get()"]
  323aa9eb_b53c_c01f_935e_081c8e055a5f -->|calls| 4cd99e59_ac1e_2a1f_0946_33cc1afd2532
  style 323aa9eb_b53c_c01f_935e_081c8e055a5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-node/src/source-maps.ts lines 12–43

function serializeSourceMap(map: DecodedSourceMap): string {
  let generator = new SourceMapGenerator()

  let id = 1
  let sourceTable = new DefaultMap<
    DecodedSource | null,
    {
      url: string
      content: string
    }
  >((src) => {
    return {
      url: src?.url ?? `<unknown ${id++}>`,
      content: src?.content ?? '<none>',
    }
  })

  for (let mapping of map.mappings) {
    let original = sourceTable.get(mapping.originalPosition?.source ?? null)

    generator.addMapping({
      generated: mapping.generatedPosition,
      original: mapping.originalPosition,
      source: original.url,
      name: mapping.name,
    })

    generator.setSourceContent(original.url, original.content)
  }

  return generator.toString()
}

Subdomains

Calls

Called By

Frequently Asked Questions

What does serializeSourceMap() do?
serializeSourceMap() is a function in the tailwindcss codebase.
What does serializeSourceMap() call?
serializeSourceMap() calls 1 function(s): get.
What calls serializeSourceMap()?
serializeSourceMap() is called by 1 function(s): toSourceMap.

Analyze Your Own Codebase

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

Try Supermodel Free