Home / Function/ toRawSourceMap() — tailwindcss Function Reference

toRawSourceMap() — tailwindcss Function Reference

Architecture documentation for the toRawSourceMap() function in source-map.test.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  6cbdbfb1_59a5_9e77_288e_4b086c9e78b1["toRawSourceMap()"]
  483bc469_09cd_2782_6511_f5eb78cfc4c1["run()"]
  483bc469_09cd_2782_6511_f5eb78cfc4c1 -->|calls| 6cbdbfb1_59a5_9e77_288e_4b086c9e78b1
  4cd99e59_ac1e_2a1f_0946_33cc1afd2532["get()"]
  6cbdbfb1_59a5_9e77_288e_4b086c9e78b1 -->|calls| 4cd99e59_ac1e_2a1f_0946_33cc1afd2532
  style 6cbdbfb1_59a5_9e77_288e_4b086c9e78b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/source-maps/source-map.test.ts lines 50–81

function toRawSourceMap(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 ?? undefined,
    })

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

  return generator.toString()
}

Subdomains

Calls

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free