Home / Function/ getSourceMapUrl() — vite Function Reference

getSourceMapUrl() — vite Function Reference

Architecture documentation for the getSourceMapUrl() function in worker-sourcemap.spec.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  d64bd1ed_22b8_a345_cf7f_1f1697b7584e["getSourceMapUrl()"]
  9d0b924b_7a10_c58e_7404_1192e3190e3e["worker-sourcemap.spec.ts"]
  d64bd1ed_22b8_a345_cf7f_1f1697b7584e -->|defined in| 9d0b924b_7a10_c58e_7404_1192e3190e3e
  style d64bd1ed_22b8_a345_cf7f_1f1697b7584e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

playground/worker/__tests__/sourcemap/worker-sourcemap.spec.ts lines 119–128

function getSourceMapUrl(code: string): string {
  const regex = /\/\/[#@]\ssource(?:Mapping)?URL=\s*(\S+)/g
  const matches = [...code.matchAll(regex)]
  const results = matches.at(-1)

  if (results && results.length >= 2) {
    return results[1]
  }
  return null
}

Domain

Subdomains

Frequently Asked Questions

What does getSourceMapUrl() do?
getSourceMapUrl() is a function in the vite codebase, defined in playground/worker/__tests__/sourcemap/worker-sourcemap.spec.ts.
Where is getSourceMapUrl() defined?
getSourceMapUrl() is defined in playground/worker/__tests__/sourcemap/worker-sourcemap.spec.ts at line 119.

Analyze Your Own Codebase

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

Try Supermodel Free