Home / Function/ getRelativeUrlFromDocument() — vite Function Reference

getRelativeUrlFromDocument() — vite Function Reference

Architecture documentation for the getRelativeUrlFromDocument() function in build.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  b4c7575f_1493_ac14_e5b0_c13cced58781["getRelativeUrlFromDocument()"]
  45981d85_cbdd_e969_8c88_c17072ea0eda["build.ts"]
  b4c7575f_1493_ac14_e5b0_c13cced58781 -->|defined in| 45981d85_cbdd_e969_8c88_c17072ea0eda
  b7ee159d_9bf3_6c73_a076_3ca2cb8785b5["relativeUrlMechanisms.cjs()"]
  b7ee159d_9bf3_6c73_a076_3ca2cb8785b5 -->|calls| b4c7575f_1493_ac14_e5b0_c13cced58781
  23383098_8f77_0454_5304_143cf25baa83["relativeUrlMechanisms.iife()"]
  23383098_8f77_0454_5304_143cf25baa83 -->|calls| b4c7575f_1493_ac14_e5b0_c13cced58781
  3b7491c0_90d0_3f05_a53d_9586858b2a2e["relativeUrlMechanisms.umd()"]
  3b7491c0_90d0_3f05_a53d_9586858b2a2e -->|calls| b4c7575f_1493_ac14_e5b0_c13cced58781
  4135bb51_464e_bb21_c7cb_43a3f06007a8["getResolveUrl()"]
  b4c7575f_1493_ac14_e5b0_c13cced58781 -->|calls| 4135bb51_464e_bb21_c7cb_43a3f06007a8
  9b07f141_2a1b_a452_87bd_d6f801123c56["escapeId()"]
  b4c7575f_1493_ac14_e5b0_c13cced58781 -->|calls| 9b07f141_2a1b_a452_87bd_d6f801123c56
  44a58113_befe_8307_2b82_9d9d5c9c0929["partialEncodeURIPath()"]
  b4c7575f_1493_ac14_e5b0_c13cced58781 -->|calls| 44a58113_befe_8307_2b82_9d9d5c9c0929
  style b4c7575f_1493_ac14_e5b0_c13cced58781 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/build.ts lines 1529–1534

const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
  getResolveUrl(
    `'${escapeId(partialEncodeURIPath(relativePath))}', ${
      umd ? `typeof document === 'undefined' ? location.href : ` : ''
    }document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`,
  )

Domain

Subdomains

Frequently Asked Questions

What does getRelativeUrlFromDocument() do?
getRelativeUrlFromDocument() is a function in the vite codebase, defined in packages/vite/src/node/build.ts.
Where is getRelativeUrlFromDocument() defined?
getRelativeUrlFromDocument() is defined in packages/vite/src/node/build.ts at line 1529.
What does getRelativeUrlFromDocument() call?
getRelativeUrlFromDocument() calls 3 function(s): escapeId, getResolveUrl, partialEncodeURIPath.
What calls getRelativeUrlFromDocument()?
getRelativeUrlFromDocument() is called by 3 function(s): relativeUrlMechanisms.cjs, relativeUrlMechanisms.iife, relativeUrlMechanisms.umd.

Analyze Your Own Codebase

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

Try Supermodel Free