Home / Function/ toSourceMap() — tailwindcss Function Reference

toSourceMap() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  43b2801c_3219_cfff_896d_761d438d49a1["toSourceMap()"]
  a661fa3d_ae92_9ae8_e742_9b48cdfdd156["serializeSourceMap()"]
  43b2801c_3219_cfff_896d_761d438d49a1 -->|calls| a661fa3d_ae92_9ae8_e742_9b48cdfdd156
  style 43b2801c_3219_cfff_896d_761d438d49a1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-node/src/source-maps.ts lines 45–60

export function toSourceMap(map: DecodedSourceMap | string): SourceMap {
  let raw = typeof map === 'string' ? map : serializeSourceMap(map)

  function comment(url: string) {
    return `/*# sourceMappingURL=${url} */\n`
  }

  return {
    raw,
    get inline() {
      let inlined = Buffer.from(raw, 'utf-8').toString('base64')
      return comment(`data:application/json;base64,${inlined}`)
    },
    comment,
  }
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free