Home / Function/ joinUrlSegments() — vite Function Reference

joinUrlSegments() — vite Function Reference

Architecture documentation for the joinUrlSegments() function in index.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  f7066b1b_88f3_440e_8604_7291c3676851["joinUrlSegments()"]
  9776ecb6_00c0_b3b9_b3f7_177fedabeacc["index.ts"]
  f7066b1b_88f3_440e_8604_7291c3676851 -->|defined in| 9776ecb6_00c0_b3b9_b3f7_177fedabeacc
  93378aa0_5b0f_e84a_a1cf_4da651efbca1["toOutputFilePathInHtml()"]
  93378aa0_5b0f_e84a_a1cf_4da651efbca1 -->|calls| f7066b1b_88f3_440e_8604_7291c3676851
  style f7066b1b_88f3_440e_8604_7291c3676851 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/plugin-legacy/src/index.ts lines 89–100

function joinUrlSegments(a: string, b: string): string {
  if (!a || !b) {
    return a || b || ''
  }
  if (a.endsWith('/')) {
    a = a.substring(0, a.length - 1)
  }
  if (b[0] !== '/') {
    b = '/' + b
  }
  return a + b
}

Domain

Subdomains

Frequently Asked Questions

What does joinUrlSegments() do?
joinUrlSegments() is a function in the vite codebase, defined in packages/plugin-legacy/src/index.ts.
Where is joinUrlSegments() defined?
joinUrlSegments() is defined in packages/plugin-legacy/src/index.ts at line 89.
What calls joinUrlSegments()?
joinUrlSegments() is called by 1 function(s): toOutputFilePathInHtml.

Analyze Your Own Codebase

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

Try Supermodel Free